Public report of sipeed/picoclaw, published 24 October 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.10.5). Watchdog 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, 24 October 2026, 02:13 UTC · Survey ID cd_3a21697e73f348dda310da717cdcf1dc

sipeed/picoclaw

Measured 24 October 2026, 02:08 UTC, at code version bbf6893

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 50out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 4 since the last survey

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

A large codebase: 141,158 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.7 person-years · Weakest lens: Accessibility, 44

Findings by how serious they are

104 critical 1291 serious 222 minor

15 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 02:08 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 Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸

80of 85 dimensions measured by tools. The other 5 are advisory notes from an AI model, which explain the code but don't count towards the score.
1570of 1617 findings point to an exact file and line, so you can open each one in the code. The other 47 concern the repository as a whole, such as missing documentation.
85dimensions across 7 lenses, read from 141,158 lines of product code in 2 projects.
Chapters

Executive summary

sipeed/picoclaw scores 50 out of 100 and is rated Adequate, while four of its seven lenses score higher still: Performance at 90, rated Exemplary, Architecture at 83 and Security and Compliance at 63, both rated Adequate, and Maturity at 81, rated Strong. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The score is lower than those four because the weakest lens counts most, and here that is Accessibility, which scores 44 and is rated Adequate. Its Keyboard semantics dimension scores 1 out of 10, and until that reaches 4, Accessibility can't be rated higher than Adequate. The first actions are to resolve the 3 Leaked secret finding(s) in Secret Scanning and to make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href, and if Accessibility rose to 70, the score would rise from 50 to about 55.

104 findings are critical: 79 in Static Analysis (SAST), nine in Forms & labels, seven in IaC & Container Security, four in Keyboard semantics, three in Secret Scanning and two in Dependency Vulnerabilities.

Watchdog couldn't measure 15 dimensions in this code, among them Code Coverage, Internal API Consistency and Navigability, so they are left out of the score. The product code is 141,158 lines, which would take an estimated 1.7 person-years, around €250,000, to rebuild.

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

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

If Accessibility rose from 44 to 70, the lowest score rated Strong, the score would rise from 50 to about 55.

Code composition: what the lines of code are
Product code 54%Tests 46%
New since the last survey: 23 findings

These 23 critical or serious findings weren't in the previous survey, on 10 October 2026.

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

Fixed since the last survey: 172 findings

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

  • Dependency Vulnerabilities · Medium CVE: GO-2026-5841 REDACTED
  • Supply-chain Provenance & Signing REDACTED
  • Supply-chain Provenance & Signing REDACTED
  • Code Duplication · Duplicated block (12 lines × 3 locations) web/frontend/src/components/app-header.tsx
  • Code Duplication · Duplicated block (12 lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx
  • Code Duplication · Duplicated block (11 lines × 4 locations) web/frontend/src/components/app-header.tsx
  • Code Duplication · Duplicated block (11 lines × 2 locations) web/frontend/src/components/channels/channel-config-page.tsx
  • Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) web/frontend/src/components/channels/channel-config-page.tsx
  • Code Duplication · Duplicated block (11 lines × 2 locations) web/frontend/src/components/channels/channel-forms/generic-form.tsx
  • Code Duplication · Duplicated block (11 lines × 2 locations) web/frontend/src/components/models/models-page.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) web/frontend/src/components/channels/channel-forms/slack-form.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) web/frontend/src/components/channels/channel-forms/wecom-form.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) web/frontend/src/components/chat/assistant-message.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) web/frontend/src/features/chat/protocol.ts
  • Code Duplication · Duplicated block with local edits (10 matched lines × 2 locations) web/frontend/src/features/chat/protocol.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) web/frontend/src/components/agent/skills/skills-list.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) web/frontend/src/components/config/form-model.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) web/frontend/src/components/models/fetch-models-dialog.tsx
  • Code Duplication · Duplicated block (8 lines × 2 locations) web/frontend/src/api/models.ts
  • Code Duplication · Duplicated block (8 lines × 5 locations) web/frontend/src/components/channels/channel-config-page.tsx
  • Code Duplication · Duplicated block (7 lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx
  • Dead Code · Dead file (~118 LoC) web/frontend/src/components/models/model-validation.ts
  • Dead Code · Dead file (~118 LoC) web/frontend/src/hooks/use-session-history.ts
  • Dead Code · Dead file (~113 LoC) web/frontend/src/components/agent/tools/web-search-tab.tsx
  • Dead Code · Dead file (~109 LoC) web/frontend/src/components/chat/session-history-menu.tsx
  • Dead Code · Dead file (~108 LoC) web/frontend/src/components/credentials/anthropic-credential-card.tsx
  • Dead Code · Dead file (~106 LoC) web/frontend/src/components/credentials/antigravity-credential-card.tsx
  • Dead Code · Dead file (~104 LoC) web/frontend/src/api/oauth.ts
  • Dead Code · Dead file (~104 LoC) web/frontend/src/components/chat/model-selector.tsx
  • Dead Code · Dead file (~103 LoC) web/frontend/src/components/logs/logs-panel.tsx
  • Dead Code · Dead file (~102 LoC) web/frontend/src/components/logs/log-level-select.tsx
  • Dead Code · Dead file (~101 LoC) web/frontend/src/routes/__root.tsx
  • Dead Code · Dead file (~100 LoC) web/frontend/src/components/chat/user-message.tsx
  • Dead Code · Dead file (~98 LoC) web/frontend/src/hooks/use-gateway-logs.ts
  • Dead Code · Dead file (~93 LoC) web/frontend/src/components/models/provider-section.tsx
  • Dead Code · Dead file (~92 LoC) web/frontend/src/components/credentials/device-code-sheet.tsx
  • Dead Code · Dead file (~87 LoC) web/frontend/src/components/agent/tools/tools-page.tsx
  • Dead Code · Dead file (~87 LoC) web/frontend/src/components/chat/chat-empty-state.tsx
  • Dead Code · Dead file (~86 LoC) web/frontend/src/components/agent/skills/origin-utils.ts
  • Dead Code · Dead file (~86 LoC) web/frontend/src/components/agent/skills/skills-list.tsx
  • Dead Code · Dead file (~85 LoC) web/frontend/src/components/models/delete-model-dialog.tsx
  • Dead Code · Dead file (~84 LoC) web/frontend/src/components/agent/skills/skill-card.tsx
  • Dead Code · Dead file (~75 LoC) web/frontend/src/api/sessions.ts
  • Dead Code · Dead file (~71 LoC) web/frontend/src/hooks/use-pico-chat.ts
  • Dead Code · Dead file (~69 LoC) web/frontend/src/features/chat/websocket.ts
  • Dead Code · Dead file (~66 LoC) web/frontend/src/components/agent/skills/delete-dialog.tsx
  • Dead Code · Dead file (~57 LoC) web/frontend/src/components/credentials/logout-confirm-dialog.tsx
  • Dead Code · Dead file (~56 LoC) web/frontend/src/components/agent/tools/tools-tabs.tsx
  • Dead Code · Dead file (~54 LoC) web/frontend/src/components/models/provider-icon.tsx
  • Dead Code · Dead file (~52 LoC) web/frontend/src/hooks/use-log-wrap-columns.ts
  • Dead Code · Dead file (~47 LoC) web/frontend/src/components/logs/logs-page.tsx
  • Dead Code · Dead file (~46 LoC) web/frontend/src/components/agent/skills/origin-badge.tsx
  • Dead Code · Dead file (~44 LoC) web/frontend/src/components/chat/typing-indicator.tsx
  • Dead Code · Dead file (~44 LoC) web/frontend/src/components/credentials/credential-card.tsx
  • Dead Code · Dead file (~43 LoC) web/frontend/src/components/credentials/provider-status-line.tsx
  • Dead Code · Dead file (~40 LoC) web/frontend/src/api/pico.ts
  • Dead Code · Dead file (~39 LoC) web/frontend/src/components/agent/skills/stats.tsx
  • Dead Code · Dead file (~29 LoC) web/frontend/src/components/app-layout.tsx
  • Dead Code · Dead file (~28 LoC) web/frontend/src/components/agent/tools/tool-status-badge.tsx
  • Dead Code · Dead file (~27 LoC) web/frontend/src/components/agent/skills/page-skeleton.tsx
  • Dead Code · Dead file (~24 LoC) web/frontend/src/components/logs/ansi-log-line.tsx
  • Dead Code · Dead file (~23 LoC) web/frontend/src/components/secret-placeholder.ts
  • Dead Code · Dead file (~22 LoC) web/frontend/src/routes/channels/route.tsx
  • Dead Code · Dead file (~21 LoC) web/frontend/src/components/models/model-provider-form-shared.ts
  • Dead Code · Dead file (~19 LoC) web/frontend/src/hooks/use-mobile.ts
  • Dead Code · Dead file (~17 LoC) web/frontend/src/components/agent/skills/types.ts
  • Dead Code · Dead file (~11 LoC) web/frontend/src/routes/agent/skills.tsx
  • Dead Code · Dead file (~11 LoC) web/frontend/src/routes/agent/tools.tsx
  • Dead Code · Dead file (~9 LoC) web/frontend/src/components/agent/tools/types.ts
  • Dead Code · Dead file (~7 LoC) web/frontend/src/routes/config.raw.tsx
  • Dead Code · Dead file (~7 LoC) web/frontend/src/routes/credentials.tsx
  • Dead Code · Dead file (~7 LoC) web/frontend/src/routes/index.tsx
  • Dead Code · Dead file (~7 LoC) web/frontend/src/routes/logs.tsx
  • Dead Code · Dead file (~7 LoC) web/frontend/src/routes/models.tsx
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/config/config_channel.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/credential/credential.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/evolution/skill_content.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/evolution/drafts.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/gateway/gateway.go
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) pkg/mcp/manager.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/mcp/isolated_command_transport.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/memory/jsonl.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/memory/jsonl.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/memory/jsonl.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/migrate.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
  • Exception handling · Swallowed exception (caught, then discarded) pkg/migrate/sources/openclaw/openclaw_config.go
Rebuild cost: about €250,000 · Estimate
Cost to rebuild€82,000 to €410,000, for 1,373 to 4,354 hours of work, about 1.7 person-years for 1 to 4 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 50. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 141,158 lines of product code

How the estimate is made: Watchdog prices 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 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 4 points · Low effort · Secret Scanning
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 4 points · Medium effort · Keyboard semantics
3
Add tests that import the unreached modules (directly or through their public entry).
Raises the score by about 2 points · Medium effort · Test Coverage

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 €250,000 to build again, about 1.7 person-years of work. Its weakest lens is Accessibility, at 44 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 3 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 3 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 31,304 lines over the last 90 days, which is about 126,955 lines a year. At that pace, the extra work comes to an estimated 15.7 to 94 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 Watchdog's 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; 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.

219 modules, with 372 dependencies between them. 4 loops run through 20 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 179 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 github.com/sipeed/picoclaw/pkg/config2 github.com/sipeed/picoclaw/pkg/media3 github.com/sipeed/picoclaw/pkg/providers/protocoltypes4 web.frontend.src.api.oauth5 web.frontend.src.api.skills6 web.frontend.src.components.agent.tools7 web.frontend.src.components.channels.channel-forms8 web.frontend.src.components.chat9 web.frontend.src.components.credentials10 web.frontend.src.components.models11 web.frontend.src.store.chat12 github.com/sipeed/picoclaw/pkg/audio/tts13 github.com/sipeed/picoclaw/pkg/events14 github.com/sipeed/picoclaw/pkg/providers/anthropic15 github.com/sipeed/picoclaw/pkg/skills16 github.com/sipeed/picoclaw/pkg/utils17 web.frontend.src.api18 web.frontend.src.components.agent.skills19 web.frontend.src.features.chat20 web.frontend.src.hooks21 github.com/sipeed/picoclaw/pkg/bus22 github.com/sipeed/picoclaw/pkg/providers/oauth23 github.com/sipeed/picoclaw/pkg/channels24 github.com/sipeed/picoclaw/pkg/providers/httpapi25 github.com/sipeed/picoclaw/pkg/routing26 github.com/sipeed/picoclaw/pkg/agent/interfaces27 github.com/sipeed/picoclaw/pkg/channels/telegram28 github.com/sipeed/picoclaw/pkg/providers/cli29 github.com/sipeed/picoclaw/pkg/session30 github.com/sipeed/picoclaw/pkg/providers31 github.com/sipeed/picoclaw/pkg/tools/shared32 github.com/sipeed/picoclaw/pkg/audio/asr33 github.com/sipeed/picoclaw/pkg/providers/anthropic_messages34 github.com/sipeed/picoclaw/pkg/providers/azure35 github.com/sipeed/picoclaw/pkg/providers/bedrock36 github.com/sipeed/picoclaw/pkg/tools/integration37 github.com/sipeed/picoclaw/web/backend/api38 github.com/sipeed/picoclaw/pkg/tools39 github.com/sipeed/picoclaw/pkg/agent40 github.com/sipeed/picoclaw/pkg/gateway
1 github.com/sipeed/picoclaw/pkg/config
2 github.com/sipeed/picoclaw/pkg/media
3 github.com/sipeed/picoclaw/pkg/providers/protocoltypes
4 web.frontend.src.api.oauth
5 web.frontend.src.api.skills
6 web.frontend.src.components.agent.tools
7 web.frontend.src.components.channels.channel-forms
8 web.frontend.src.components.chat
9 web.frontend.src.components.credentials
10 web.frontend.src.components.models
11 web.frontend.src.store.chat
12 github.com/sipeed/picoclaw/pkg/audio/tts21
13 github.com/sipeed/picoclaw/pkg/events1
14 github.com/sipeed/picoclaw/pkg/providers/anthropic61111
15 github.com/sipeed/picoclaw/pkg/skills2
16 github.com/sipeed/picoclaw/pkg/utils2
17 web.frontend.src.api55
18 web.frontend.src.components.agent.skills2
19 web.frontend.src.features.chat2
20 web.frontend.src.hooks1
21 github.com/sipeed/picoclaw/pkg/bus51
22 github.com/sipeed/picoclaw/pkg/providers/oauth142333
23 github.com/sipeed/picoclaw/pkg/channels846291
24 github.com/sipeed/picoclaw/pkg/providers/httpapi17222
25 github.com/sipeed/picoclaw/pkg/routing522
26 github.com/sipeed/picoclaw/pkg/agent/interfaces71
27 github.com/sipeed/picoclaw/pkg/channels/telegram41114
28 github.com/sipeed/picoclaw/pkg/providers/cli15334
29 github.com/sipeed/picoclaw/pkg/session5112
30 github.com/sipeed/picoclaw/pkg/providers217645
31 github.com/sipeed/picoclaw/pkg/tools/shared11
32 github.com/sipeed/picoclaw/pkg/audio/asr241
33 github.com/sipeed/picoclaw/pkg/providers/anthropic_messages61111
34 github.com/sipeed/picoclaw/pkg/providers/azure31111
35 github.com/sipeed/picoclaw/pkg/providers/bedrock61111
36 github.com/sipeed/picoclaw/pkg/tools/integration1422721118
37 github.com/sipeed/picoclaw/web/backend/api1053111
38 github.com/sipeed/picoclaw/pkg/tools1331222133311
39 github.com/sipeed/picoclaw/pkg/agent22436281151118511113914
40 github.com/sipeed/picoclaw/pkg/gateway11311121121
Uses a module listed above itPart of a loopThe module itself
1 github.com/sipeed/picoclaw/pkg/config2 github.com/sipeed/picoclaw/pkg/media3 github.com/sipeed/picoclaw/pkg/providers/protocoltypes4 web.frontend.src.api.oauth5 web.frontend.src.api.skills6 web.frontend.src.components.agent.tools7 web.frontend.src.components.channels.channel-forms8 web.frontend.src.components.chat9 web.frontend.src.components.credentials10 web.frontend.src.components.models11 web.frontend.src.store.chat12 github.com/sipeed/picoclaw/pkg/audio/tts13 github.com/sipeed/picoclaw/pkg/events14 github.com/sipeed/picoclaw/pkg/providers/anthropic15 github.com/sipeed/picoclaw/pkg/skills16 github.com/sipeed/picoclaw/pkg/utils17 web.frontend.src.api18 web.frontend.src.components.agent.skills19 web.frontend.src.features.chat20 web.frontend.src.hooks21 github.com/sipeed/picoclaw/pkg/bus22 github.com/sipeed/picoclaw/pkg/providers/oauth23 github.com/sipeed/picoclaw/pkg/channels24 github.com/sipeed/picoclaw/pkg/providers/httpapi25 github.com/sipeed/picoclaw/pkg/routing26 github.com/sipeed/picoclaw/pkg/agent/interfaces27 github.com/sipeed/picoclaw/pkg/channels/telegram28 github.com/sipeed/picoclaw/pkg/providers/cli29 github.com/sipeed/picoclaw/pkg/session30 github.com/sipeed/picoclaw/pkg/providers31 github.com/sipeed/picoclaw/pkg/tools/shared32 github.com/sipeed/picoclaw/pkg/audio/asr33 github.com/sipeed/picoclaw/pkg/providers/anthropic_messages34 github.com/sipeed/picoclaw/pkg/providers/azure35 github.com/sipeed/picoclaw/pkg/providers/bedrock36 github.com/sipeed/picoclaw/pkg/tools/integration37 github.com/sipeed/picoclaw/web/backend/api38 github.com/sipeed/picoclaw/pkg/tools39 github.com/sipeed/picoclaw/pkg/agent40 github.com/sipeed/picoclaw/pkg/gatewaygithub.com/sipeed/picoclaw/pkg/config1github.com/sipeed/picoclaw/pkg/media2github.com/sipeed/picoclaw/pkg/providers/protocoltypes3web.frontend.src.api.oauth4web.frontend.src.api.skills5web.frontend.src.components.agent.tools6web.frontend.src.components.channels.channel-forms7web.frontend.src.components.chat8web.frontend.src.components.credentials9web.frontend.src.components.models10web.frontend.src.store.chat11github.com/sipeed/picoclaw/pkg/audio/tts12github.com/sipeed/picoclaw/pkg/events13github.com/sipeed/picoclaw/pkg/providers/anthropic14github.com/sipeed/picoclaw/pkg/skills15github.com/sipeed/picoclaw/pkg/utils16web.frontend.src.api17web.frontend.src.components.agent.skills18web.frontend.src.features.chat19web.frontend.src.hooks20github.com/sipeed/picoclaw/pkg/bus21github.com/sipeed/picoclaw/pkg/providers/oauth22github.com/sipeed/picoclaw/pkg/channels23github.com/sipeed/picoclaw/pkg/providers/httpapi24github.com/sipeed/picoclaw/pkg/routing25github.com/sipeed/picoclaw/pkg/agent/interfaces26github.com/sipeed/picoclaw/pkg/channels/telegram27github.com/sipeed/picoclaw/pkg/providers/cli28github.com/sipeed/picoclaw/pkg/session29github.com/sipeed/picoclaw/pkg/providers30github.com/sipeed/picoclaw/pkg/tools/shared31github.com/sipeed/picoclaw/pkg/audio/asr32github.com/sipeed/picoclaw/pkg/providers/anthropic_messages33github.com/sipeed/picoclaw/pkg/providers/azure34github.com/sipeed/picoclaw/pkg/providers/bedrock35github.com/sipeed/picoclaw/pkg/tools/integration36github.com/sipeed/picoclaw/web/backend/api37github.com/sipeed/picoclaw/pkg/tools38github.com/sipeed/picoclaw/pkg/agent39github.com/sipeed/picoclaw/pkg/gateway4021161111225522151142333846291172225227141114153345112217645112416111131111611111422721118105311113312221333112243628115111851111391411311121121+179 more modules (most-connected shown)

At a glance — Code Health · 50% · Adequate · gated by D1, D2, R7 ·

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

At a glance — Maturity · 81% · Strong ·

At a glance — Readiness · 48% · Adequate · gated by D13, R4, P7 ·

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

At a glance — Accessibility · 44% · Adequate · gated by AC4 ·

At a glance — Performance · 90% · 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 — Injection127High / Critical
A02:2025 — Security Misconfiguration22High / Critical
A03:2025 — Software Supply Chain Failures16High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Immediately resolve the three leaked secrets in the specified source files to secure the codebase. Next, ensure all custom controls are fully keyboard-operable and correct anchor links to improve accessibility. Expand test coverage by importing and testing previously unreachable production modules to validate core functionality. Finally, enforce accessibility standards by integrating linting and automated testing into the CI pipeline, while ensuring visible focus styles, reduced motion support, and sufficient color contrast.

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

Do thisHelpsEffortDimension
Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED.+4.1 ptsLowSecret Scanning
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+3.5 ptsMediumKeyboard semantics
Add tests that import the unreached modules (directly or through their public entry).+2.5 ptsMediumTest Coverage
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.+2.3 ptsMediumA11y enforcement
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+2.3 ptsMediumVisual & motion safety
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+2.3 ptsMediumForms & labels
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.+2.2 ptsMediumDead Code
Improve Dependency Hygiene — currently 8.6/10.+2.1 ptsMediumDependency Hygiene

File quality

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

FileScoreBandWorst signal
REDACTED0.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.9SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.1SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.5MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 104

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

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

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

Could not be resolved — 15

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

Watchdog 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. 80 of 85 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 85 dimensions across the health lenses
D1D2D3D4D5D6D7D9D11D12D13D14D15D16D17D19D20D21D25D26D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX2AX3AX4M1M2M3M4P1P2P3P4P5P6P7PF1PF2PF3R1R10R11R2R3R4R6R7R8R9X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X28X29X3X30X5

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, 1570 of 1617 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
Watchdog 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
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a16baa-89e7-702f-bf82-ad274f7391c6.

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 — Watchdog 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: test source is present (.go) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `web/frontend/src/components/agent/skills/detail-sheet.tsx`, `web/frontend/src/features/chat/history.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.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in pkg/config/config_channel.go, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker/docker-compose.yml). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — no service selected; runtime evidence skipped.
  • C1 Data Protection — not measured this run — Watchdog 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 — Watchdog 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 — Watchdog 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 — Watchdog 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 and Scala 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 — Watchdog 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 and Scala 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 — Watchdog measured this, but not all of it. What it 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. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
  • R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 54 further occurrence(s) are not listed individually; the score already reflects all 94.
  • S1 Web-Security Posture — not measured this run — Watchdog 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.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's Go 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.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 119 further occurrence(s) are not listed individually; the score already reflects all 159.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 4 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs 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.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
  • 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.
  • 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.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (5): D19, D20, D21, D25, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity3.2 / 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.2 / 10 · rule-coverage 100% · ceiling Prevented

216 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was config.v0ProvidersMapToModelList at 212. A further 7 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being ToolsConfig.IsToolEnabled at 25 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: pkg/agent/runtime_event_logger.go (agent.appendRuntimeEventPayloadSummary at 20), pkg/tools/hardware/serial_unix.go (hardwaretools.serialBaudToUnix at 19), pkg/agent/prompt.go (agent.slotPriority at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

config.v0ProvidersMapToModelList (cyclomatic 212)pkg/config/config_old.go:32
Pipeline.ExecuteTools (cyclomatic 112)pkg/agent/pipeline_execute.go:111
Pipeline.CallLLM (cyclomatic 111)pkg/agent/pipeline_llm.go:22
models-page.ModelsPage (cyclomatic 99)web/frontend/src/components/models/models-page.tsx:466
converter.walk (cyclomatic 70)pkg/utils/markdown.go:138

+ 211 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 config.v0ProvidersMapToModelList (cyclomatic 212). — Refactoring it lifts Cyclomatic Complexity from 3.2 to about 4.3/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

359 method(s) exceeded the cognitive complexity threshold of 15; the worst was Pipeline.ExecuteTools at 307.

Pipeline.ExecuteTools (cognitive 307)pkg/agent/pipeline_execute.go:111
config.v0ProvidersMapToModelList (cognitive 230)pkg/config/config_old.go:32
Pipeline.CallLLM (cognitive 156)pkg/agent/pipeline_llm.go:22
agent.registerSharedTools (cognitive 103)pkg/agent/agent_init.go:108
api.applySecureStringsToStruct (cognitive 100)web/backend/api/config.go:740

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

What to do

  1. Bring the 32 bodies over 60 down to 60 or less in Cognitive Complexity — start with Pipeline.ExecuteTools (cognitive 307), config.v0ProvidersMapToModelList (cognitive 230), Pipeline.CallLLM (cognitive 156). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 32 together lifts Cognitive Complexity from 2.0 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes6.6 / 10Adequate✓ Tool-verified

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

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

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

157 god class(es) detected.

FunctionTooLong: add-model-sheet.AddModelSheet · ×57web/frontend/src/components/models/add-model-sheet.tsx:107
FileTooLong: integration/web.go · ×45pkg/tools/integration/web.go
MethodTooLong: Pipeline.ExecuteTools · ×27pkg/agent/pipeline_execute.go:111
TooManyMethods: Handler · ×12web/backend/api/router.go:12
ClassTooLong: Store · ×12REDACTED:14

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

What to do

  1. Resolve the 57 FunctionTooLong finding(s) in God Classes — start with config-sections.tsx (5), add-model-sheet.tsx, models-page.tsx. — One of this dimension's main actionable groups (57 warning-level).
  2. Resolve the 45 FileTooLong finding(s) in God Classes — start with REDACTED (2), gateway.go (2), REDACTED (2). — One of this dimension's main actionable groups (45 warning-level).
  3. Resolve the 27 MethodTooLong finding(s) in God Classes — start with turn_coord.go (2), web.go (2), telegram.go (2). — One of this dimension's main actionable groups (27 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.1 / 10Stronggated by 271 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

265 duplicated block group(s) detected. A further 6 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (8 lines × 2) · ×28cmd/membench/main.go:63
Duplicated block (11 lines × 2) · ×27cmd/picoclaw/internal/auth/helpers.go:239
Duplicated block (10 lines × 2) · ×27cmd/membench/eval.go:57
Duplicated block (7 lines × 2) · ×18cmd/membench/llm_client.go:121
Duplicated block (12 lines × 2) · ×15cmd/picoclaw/internal/mcp/helpers.go:336

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

What to do

  1. Resolve the 28 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with shell.go (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 27 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with wecom.go (3), helpers.go (2), web.go (2). — One of this dimension's main actionable groups (27 warning-level).
  3. Resolve the 27 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with hooks.go (3), gemini_provider.go (3), helpers.go (2). — One of this dimension's main actionable groups (27 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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.8 / 10Stronggated by 3 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.8 / 10 · rule-coverage 100% · ceiling Verified

3 of 180 classes have LCOM4 above 3.

Low cohesion: Handler (LCOM4 12) · ×3web/backend/api/router.go:12

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with router.go, manager.go, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

All 1 mechanizable ADR(s) are enforced: 1 by analyzers, 0 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

3649 test methods: 3487 unit, 162 integration, 0 BDD, 0 e2e. The Go suite contributes 3649 test case(s) across 324 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 16 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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

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

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

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

0 flaky across 1 measured tier(s). Go (github.com/sipeed/picoclaw): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene8.6 8.1 / 10Strong✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

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

28 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 55 of 55 direct requirement(s) were graded against proxy.golang.org (0 not served there, 3 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Outdated: github.com/Azure/azure-sdk-for-go/sdk/azcore · ×28

What to do

  1. Improve Dependency Hygiene — currently 8.6/10. — 28 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 55 of 55 direct requirement(s) were graded against proxy.golang.org (0 not served there, 3 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.

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

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

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

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

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

3 secret(s) detected.

REDACTED

What to do

  1. Resolve the 3 Leaked secret finding(s) in Secret Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

0 of 31 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 31 production dependency(ies) this repository's committed lockfile resolves, across 1 product package.json manifest(s). Its 19 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ 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. ★ 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.4 / 10Stronggated by 30 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.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: pkg/agent/pipeline_llm.go (7×111=777); REDACTED (9×39=351); pkg/tools/integration/web.go (9×33=297) Repeated repair below the complexity floor: pkg/agent/context_usage.go (3 of 3 changes were fixes)

Hotspot: pkg/agent/pipeline_llm.go · ×29pkg/agent/pipeline_llm.go:22
Repeated repair: pkg/agent/context_usage.gopkg/agent/context_usage.go:17

What to do

  1. Resolve the 29 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), provider.go (2), pipeline_llm.go. — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with context_usage.go. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

47 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 414 of the 691 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

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

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

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

10 deducted task-comment markers across 141158 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 · ×10pkg/agent/pipeline.go:23

What to do

  1. Resolve the 10 TodoComment finding(s) in Explicit Debt — start with factory_test.go (2), pipeline.go, agent.go. — One of this dimension's main actionable groups (10 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The repository's root README is a strong overview with hardware specs, an official website, and a complete build-and-run quick-start guide (clone repo -> first run -> set API keys -> start). The docs/ directory contains the detailed project documentation: it documents itself as the recommended layout for new or moved docs, explains reader navigation, lists principles, gives guidance on adding new documents, and covers architecture, migration, integration testing, and a complete web UI guide. All visible documents are well-structured with headings and an outline; the READMEs of each package directory (e.g., pkg/channels/) document their own directories rather than the repository as a whole. The repository's documentation is comprehensive and well-structured: the READMEs for each directory (pkg/isolation, docs/architecture/*, docs/channels/*) are complete within their own scope — they describe what the directory provides without referencing the root project overview, installation, or contribution guidance. The architecture/design documents form a cohesive reference set covering four layers of isolation, supported hook types and actions, two mounting modes, the respond action, execution order, timeouts, quick start, Go in-process example, configuration fields, environment variables, how to confirm hooks received, process-hook protocol, and troubleshooting — all present and well-organized. The visible content is unclipped by the scanner, so any missing section would be flagged only if it appears in an outline and the body is cut. The repository's READMEs and architecture/Docs markdown files are well organized with a clear overview for each channel directory. The MQTT, OneBot, and QQ channels all have an overview paragraph plus a quick-start guide (code+command examples), topic structure table, configuration section with required fields, and setup steps; the one missing element is the root README's own overview/installation/usage/contributing/licence content rather than being flagged as internal. The architecture/Docs set provides comprehensive design docs for each channel type.

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR QualityExemplary◐ Sampled · advisory

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

Evaluated 1 ADR(s) individually; mean quality 9.0/10 (consistently complete and clear). 0 flagged with a specific gap.

ADR has no Decision and Consequences sectiondocs/design/steering-spec.md:1detected by adr-integrity

✓ On the Gold path — maintain.

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D25 · ADR ConformanceExemplary◐ Sampled · advisory

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.

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

1 conform / 0 violate across 1 ADRs.

✓ On the Gold path — maintain.

Detailed fixes: d25_recommendation.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, LLM-independent.

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

What to do

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

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

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)0.0 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

127 finding(s): 0 critical, 79 high, 22 medium, 26 low. 41 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 2 file(s) — `web/frontend/src/components/agent/skills/detail-sheet.tsx` (line 38), `web/frontend/src/features/chat/history.ts` (line 30) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 6 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D30 · Dependency Vulnerabilities8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security6.2 / 10Adequate✓ 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 6.2 / 10 · rule-coverage 100% · ceiling Documented

22 finding(s): 0 critical, 7 high, 15 medium, 0 low.

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness8.6 / 10Strong✓ 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 8.6 / 10 · rule-coverage 100% · ceiling Documented

62 of 414 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is web/backend/api/wecom.go. Counted over 414 of the 691 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×62web/backend/api/wecom.go:1
Orphaned files with no living knowledge

What to do

  1. Resolve the 62 Orphaned file finding(s) in Knowledge Freshness — start with types.go (2), wecom.go, use-credentials-page.ts. — One of this dimension's main actionable groups (62 recommendation-level).
  2. Resolve the 1 Orphaned files with no living knowledge finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.8 / 10Stronggated by 4 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: factory.go↔provider.go 64%; factory_provider.go↔models.ts 60%; REDACTED↔factory.go 57%

Change coupling: factory_provider.go ↔ models.ts · ×3pkg/providers/factory_provider.go:1
Change-coupling hub: factory.go → REDACTED, migration.go, provider.gopkg/providers/factory.go

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with factory_provider.go, models.go, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with factory.go. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & 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

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

What to do

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

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

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored 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. SCORED, not informational.

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

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.

AC2 · Forms & labels4.2 / 10Weak✓ Tool-verified

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

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

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

  • This 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. (×6) — web/frontend/src/components/agent/skills/filter-bar.tsx:56, web/frontend/src/components/agent/tools/tool-library-tab.tsx:83, web/frontend/src/components/chat/model-selector.tsx:42, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. 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. (×3) — web/frontend/src/components/agent/skills/filter-bar.tsx:74, web/frontend/src/components/config/config-sections.tsx:92, web/frontend/src/components/logs/log-level-select.tsx:84
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×2) — web/frontend/src/components/agent/skills/filter-bar.tsx:105, web/frontend/src/components/agent/skills/filter-bar.tsx:117
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×6) — web/frontend/src/components/agent/tools/web-search-general-settings.tsx:126, web/frontend/src/components/agent/tools/web-search-provider-settings.tsx:273, web/frontend/src/components/config/config-sections.tsx:275, …
  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. — web/frontend/src/components/app-header.tsx:275

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 semantics1.0 / 10Critical✓ Tool-verified

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

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

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

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×3) — web/frontend/src/components/agent/skills/import-dialog.tsx:106, web/frontend/src/components/chat/assistant-message.tsx:105, web/frontend/src/components/models/catalog-dialog.tsx:219
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — web/frontend/src/components/chat/context-usage-ring.tsx:85

What to do

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

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

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

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

AC6 · Visual & motion safety4.1 / 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.

  • <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/frontend/src/components/agent/tools/tools-tabs.tsx:36
  • <span> 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/frontend/src/components/chat/typing-indicator.tsx:26, web/frontend/src/components/chat/typing-indicator.tsx:27, web/frontend/src/components/chat/typing-indicator.tsx:28
  • <div> moves — its `animate-[shimmer_2s_infinite]` 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:. — web/frontend/src/components/chat/typing-indicator.tsx:32
  • <p> moves — its `animate-[fadeSlideIn_0.4s_ease-out]` 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:. — web/frontend/src/components/chat/typing-indicator.tsx:35

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.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 109 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition6.8 / 10Strong✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

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

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

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

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

  • 1 ADR-shaped document(s) detected by content — `docs/design/steering-spec.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy9.3 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • docs/README.md names `docs/project/CONTRIBUTING.fr.md`, but no file or folder `docs/project/CONTRIBUTING.fr.md` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:59
  • docs/architecture/routing-system.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/routing-system.md:193
  • docs/architecture/routing-system.zh.md names `pkg/agent/loop_message.go`, but no file or folder `pkg/agent/loop_message.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/routing-system.zh.md:22
  • docs/architecture/routing-system.zh.md names `pkg/agent/loop_turn.go`, but no file or folder `pkg/agent/loop_turn.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/routing-system.zh.md:22
  • docs/architecture/routing-system.zh.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/routing-system.zh.md:195
  • docs/architecture/runtime-events.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/runtime-events.md:5
  • docs/architecture/runtime-events.zh.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/runtime-events.zh.md:5
  • docs/architecture/session-system.md names `pkg/memory.Store`, but no file or folder `pkg/memory.Store` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.md:29
  • docs/architecture/session-system.md names `pkg/memory.JSONLStore`, but no file or folder `pkg/memory.JSONLStore` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.md:157
  • docs/architecture/session-system.zh.md names `pkg/memory.Store`, but no file or folder `pkg/memory.Store` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.zh.md:29
  • docs/architecture/session-system.zh.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.zh.md:32
  • docs/architecture/session-system.zh.md names `pkg/agent/loop_message.go`, but no file or folder `pkg/agent/loop_message.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.zh.md:32
  • docs/architecture/session-system.zh.md names `pkg/memory.JSONLStore`, but no file or folder `pkg/memory.JSONLStore` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/session-system.zh.md:158
  • docs/design/hook-system-design.zh.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:4
  • docs/design/hook-system-design.zh.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:62
  • docs/design/hook-system-design.zh.md names `pkg/agent/turn.go`, but no file or folder `pkg/agent/turn.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:64
  • docs/design/hook-system-design.zh.md names `pkg/events.Kind`, but no file or folder `pkg/events.Kind` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:83
  • docs/design/hook-system-design.zh.md names `pkg/agent/eventbus.go`, but no file or folder `pkg/agent/eventbus.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:335
  • docs/design/hook-system-design.zh.md names `pkg/agent/hook_ipc.go`, but no file or folder `pkg/agent/hook_ipc.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:350
  • docs/design/hook-system-design.zh.md names `pkg/agent/hook_types.go`, but no file or folder `pkg/agent/hook_types.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:353
  • docs/design/hook-system-design.zh.md names `pkg/tools/base.go`, but no file or folder `pkg/tools/base.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/design/hook-system-design.zh.md:361
  • docs/guides/chat-apps.fr.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.fr.md:161
  • docs/guides/chat-apps.ja.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.ja.md:158
  • docs/guides/chat-apps.ms.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.ms.md:161
  • docs/guides/chat-apps.pt-br.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.pt-br.md:161
  • docs/guides/chat-apps.vi.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.vi.md:161
  • docs/guides/chat-apps.zh.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/chat-apps.zh.md:166
  • docs/guides/configuration.fr.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.fr.md:149
  • docs/guides/configuration.it.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.it.md:118
  • docs/guides/configuration.ja.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.ja.md:150
  • docs/guides/configuration.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.md:199
  • docs/guides/configuration.md documents the setting `byteplus`, but no code or configuration file names `byteplus`. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.md:736
  • docs/guides/configuration.ms.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.ms.md:137
  • docs/guides/configuration.pt-br.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.pt-br.md:150
  • docs/guides/configuration.vi.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.vi.md:150
  • docs/guides/configuration.zh.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/configuration.zh.md:193
  • docs/guides/docker.fr.md runs `docker compose -f docker/docker-compose.yml logs -f picoclaw-gateway`, but `picoclaw-gateway` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/docker.fr.md:31
  • docs/guides/docker.ja.md runs `docker compose -f docker/docker-compose.yml logs -f picoclaw-gateway`, but `picoclaw-gateway` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/docker.ja.md:31
  • docs/guides/docker.ms.md runs `docker compose -f docker/docker-compose.yml logs -f picoclaw-gateway`, but `picoclaw-gateway` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/docker.ms.md:30
  • docs/guides/docker.pt-br.md runs `docker compose -f docker/docker-compose.yml logs -f picoclaw-gateway`, but `picoclaw-gateway` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/docker.pt-br.md:31

What to do

  • Reconcile the README with reality: docs/README.md names `docs/project/CONTRIBUTING.fr.md`, but no file or folder `docs/project/CONTRIBUTING.fr.md` exists; docs/architecture/routing-system.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists; docs/architecture/routing-system.zh.md names `pkg/agent/loop_message.go`, but no file or folder `pkg/agent/loop_message.go` exists; docs/architecture/routing-system.zh.md names `pkg/agent/loop_turn.go`, but no file or folder `pkg/agent/loop_turn.go` exists; docs/architecture/routing-system.zh.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists.
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 tooling8.0 / 10Strong✓ 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.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

  • `http.Post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — REDACTED:256, REDACTED:347, REDACTED:406
  • `http.PostForm(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — REDACTED:458, REDACTED:554
  • `http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — pkg/mcp/manager.go:380

What to do

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

PF2 · Allocation hygiene7.6 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 418 use(s) across 133,971 production line(s) (~3.1/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
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 the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety9.9 / 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.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication8.8 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.

  • 6 duplicated blocks under web/frontend/src/components/ have copies in at least two of the sibling directories agent, channels, chat, config, models — 2 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/frontend/src/components/agent/skills/use-skills-page.ts:264
  • web/frontend/src/components/models/add-model-sheet.tsx:533 · web/frontend/src/components/models/edit-model-sheet.tsx:507 — the two spans are one implementation copied and then locally edited — 1175 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/frontend/src/components/models/add-model-sheet.tsx:533
  • web/frontend/src/components/channels/channel-forms/wecom-form.tsx:76 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:85 — the two spans are one implementation copied and then locally edited — 1018 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/frontend/src/components/channels/channel-forms/wecom-form.tsx:76
  • web/frontend/src/components/models/add-model-sheet.tsx:290 · web/frontend/src/components/models/edit-model-sheet.tsx:270 — the two spans are one implementation copied and then locally edited — 944 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/frontend/src/components/models/add-model-sheet.tsx:290
  • web/frontend/src/components/models/models-page.tsx:543 · web/frontend/src/components/models/models-page.tsx:609 — 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/frontend/src/components/models/models-page.tsx:543
  • web/frontend/src/routes/launcher-login.tsx:28 · web/frontend/src/routes/launcher-setup.tsx:25 — the two spans are one implementation copied and then locally edited — 327 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/frontend/src/routes/launcher-login.tsx:28
  • web/frontend/src/components/credentials/anthropic-credential-card.tsx:19 · web/frontend/src/components/credentials/openai-credential-card.tsx:22 — the two spans are one implementation copied and then locally edited — 233 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/frontend/src/components/credentials/anthropic-credential-card.tsx:19
  • web/frontend/src/components/models/add-model-sheet.tsx:240 · web/frontend/src/components/models/edit-model-sheet.tsx:225 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/frontend/src/components/models/add-model-sheet.tsx:240
  • web/frontend/src/components/channels/channel-forms/discord-form.tsx:17 · web/frontend/src/components/channels/channel-forms/feishu-form.tsx:18 — 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/frontend/src/components/channels/channel-forms/discord-form.tsx:17
  • web/frontend/src/components/channels/channel-forms/feishu-form.tsx:101 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:71 — the two spans are one implementation copied and then locally edited — 202 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/frontend/src/components/channels/channel-forms/feishu-form.tsx:101
  • web/frontend/src/components/channels/channel-forms/generic-form.tsx:398 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:137 — 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/frontend/src/components/channels/channel-forms/generic-form.tsx:398
  • web/frontend/src/components/models/catalog-dialog.tsx:284 · web/frontend/src/components/models/fetch-models-dialog.tsx:192 — 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/frontend/src/components/models/catalog-dialog.tsx:284
  • web/frontend/src/components/config/config-sections.tsx:308 · web/frontend/src/components/config/config-sections.tsx: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. — web/frontend/src/components/config/config-sections.tsx:308
  • web/frontend/src/api/system.ts:25 · web/frontend/src/api/tools.ts:47 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — web/frontend/src/api/system.ts:25
  • REDACTED:178 · REDACTED:199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:178
  • web/frontend/src/components/channels/channel-forms/wecom-form.tsx:44 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:60 — the two spans are one implementation copied and then locally edited — 150 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/frontend/src/components/channels/channel-forms/wecom-form.tsx:44
  • web/frontend/src/components/agent/skills/use-skills-page.ts:264 · web/frontend/src/components/chat/chat-page.tsx:228 — the two spans are one implementation copied and then locally edited — 114 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/frontend/src/components/agent/skills/use-skills-page.ts:264
  • web/frontend/src/components/models/default-chain-dialog.tsx:132 · web/frontend/src/components/models/default-chain-dialog.tsx:152 — 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/frontend/src/components/models/default-chain-dialog.tsx:132
  • web/frontend/src/components/models/model-card.tsx:135 · web/frontend/src/components/models/model-card.tsx:171 — 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/frontend/src/components/models/model-card.tsx:135
  • web/frontend/src/components/config/config-sections.tsx:754 · web/frontend/src/components/config/config-sections.tsx:823 — 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/frontend/src/components/config/config-sections.tsx:754
  • web/frontend/src/components/models/add-model-sheet.tsx:213 · web/frontend/src/components/models/edit-model-sheet.tsx:200 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/frontend/src/components/models/add-model-sheet.tsx:213
  • web/frontend/src/components/channels/channel-forms/generic-form.tsx:62 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:29 — 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/frontend/src/components/channels/channel-forms/generic-form.tsx:62
  • web/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:59 · web/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:76 — 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/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:59
  • web/frontend/src/components/chat/message-code-block.utils.ts:128 · web/frontend/src/components/chat/message-code-block.utils.ts:262 — 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/frontend/src/components/chat/message-code-block.utils.ts:128
  • web/frontend/src/components/config/config-sections.tsx:273 · web/frontend/src/components/config/config-sections.tsx:290 — 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/frontend/src/components/config/config-sections.tsx:273
  • web/frontend/src/components/config/config-sections.tsx:781 · web/frontend/src/components/config/config-sections.tsx:814 — 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/frontend/src/components/config/config-sections.tsx:781
  • web/frontend/src/components/config/form-model.ts:446 · web/frontend/src/components/config/form-model.ts:464 — 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/frontend/src/components/config/form-model.ts:446
  • web/frontend/src/components/config/config-sections.tsx:1230 · web/frontend/src/components/config/config-sections.tsx:1256 — 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/frontend/src/components/config/config-sections.tsx:1230
  • web/frontend/src/components/credentials/anthropic-credential-card.tsx:87 · web/frontend/src/components/credentials/antigravity-credential-card.tsx:85 · web/frontend/src/components/credentials/openai-credential-card.tsx:141 — 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/frontend/src/components/credentials/anthropic-credential-card.tsx:87
  • web/frontend/src/api/channels.ts:41 · web/frontend/src/api/system.ts:34 · web/frontend/src/api/tools.ts:56 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — web/frontend/src/api/channels.ts:41
  • web/frontend/src/components/config/config-sections.tsx:207 · web/frontend/src/components/config/config-sections.tsx:445 — 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/frontend/src/components/config/config-sections.tsx:207
  • web/frontend/src/components/config/config-sections.tsx:942 · web/frontend/src/components/config/config-sections.tsx:959 — 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/frontend/src/components/config/config-sections.tsx:942
  • web/frontend/src/api/gateway.ts:26 · web/frontend/src/api/pico.ts:15 — 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/frontend/src/api/gateway.ts:26
  • REDACTED:83 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:83 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — REDACTED:83
  • web/frontend/src/components/channels/channel-forms/slack-form.tsx:21 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:46 — 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/frontend/src/components/channels/channel-forms/slack-form.tsx:21
  • web/frontend/src/components/chat/chat-empty-state.tsx:39 · web/frontend/src/components/chat/chat-empty-state.tsx:55 — 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/frontend/src/components/chat/chat-empty-state.tsx:39
  • web/frontend/src/components/credentials/anthropic-credential-card.tsx:39 · web/frontend/src/components/credentials/antigravity-credential-card.tsx:33 · web/frontend/src/components/credentials/openai-credential-card.tsx:46 — 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/frontend/src/components/credentials/anthropic-credential-card.tsx:39
  • web/frontend/src/components/credentials/antigravity-credential-card.tsx:62 · web/frontend/src/components/credentials/openai-credential-card.tsx:70 — 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/frontend/src/components/credentials/antigravity-credential-card.tsx:62
  • web/frontend/src/components/chat/model-selector.tsx:63 · web/frontend/src/components/chat/model-selector.tsx:78 — 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/frontend/src/components/chat/model-selector.tsx:63
  • web/frontend/src/components/config/config-sections.tsx:195 · web/frontend/src/components/config/config-sections.tsx:222 · web/frontend/src/components/config/config-sections.tsx:579 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/frontend/src/components/config/config-sections.tsx:195

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 Boundaries8.5 / 10Strong✓ 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/frontend/src/components/chat/message-code-block.tsx:7 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/frontend/src/components/chat/message-code-block.tsx:7
  • web/frontend/src/components/chat/message-code-block.tsx:8 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/frontend/src/components/chat/message-code-block.tsx:8

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 Complexity5.4 / 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.

  • AppHeader has cyclomatic complexity 41 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/frontend/src/components/app-header.tsx:45
  • ModelCard has cyclomatic complexity 40 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/frontend/src/components/models/model-card.tsx:32
  • EditModelSheet has cyclomatic complexity 35 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/frontend/src/components/models/edit-model-sheet.tsx:114
  • handleSave has cyclomatic complexity 34 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/frontend/src/components/config/config-page.tsx:295
  • AddModelSheet has cyclomatic complexity 34 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/frontend/src/components/models/add-model-sheet.tsx:107
  • ModelsPage has cyclomatic complexity 34 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/frontend/src/components/models/models-page.tsx:466
  • GenericForm has cyclomatic complexity 33 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 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/frontend/src/components/channels/channel-forms/generic-form.tsx:79
  • AssistantMessage has cyclomatic complexity 32 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/frontend/src/components/chat/assistant-message.tsx:41
  • parseAnsiSegments has cyclomatic complexity 30 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/frontend/src/lib/ansi-log.ts:143
  • handleSave has cyclomatic complexity 27 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/frontend/src/components/models/edit-model-sheet.tsx:327
  • parseToolCallsValue has cyclomatic complexity 26 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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/frontend/src/features/chat/tool-calls.ts:39
  • buildFormFromConfig has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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/frontend/src/components/config/form-model.ts:291
  • handleSave has cyclomatic complexity 23 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/frontend/src/components/models/add-model-sheet.tsx:353
  • ConfigPage has cyclomatic complexity 23 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/frontend/src/components/config/config-page.tsx:102
  • handlePicoMessage 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/frontend/src/features/chat/protocol.ts:96
  • DetailSheet has cyclomatic complexity 20 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/frontend/src/components/agent/skills/detail-sheet.tsx:51
  • MessageCodeBlock has cyclomatic complexity 20 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/frontend/src/components/chat/message-code-block.tsx:65
  • MarketSkillCard 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/frontend/src/components/agent/hub/market-skill-card.tsx:27
  • TestModelDialog has cyclomatic complexity 18 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/frontend/src/components/models/test-model-dialog.tsx:44

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files7.4 / 10Strong✓ Tool-verified

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

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

  • web/frontend/src/components/config/config-sections.tsx has 1243 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/frontend/src/components/config/config-sections.tsx:1
  • web/frontend/src/components/models/models-page.tsx has 1169 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/frontend/src/components/models/models-page.tsx:1
  • web/frontend/src/components/config/config-page.tsx has 804 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/frontend/src/components/config/config-page.tsx:1
  • web/frontend/src/components/models/add-model-sheet.tsx has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/frontend/src/components/models/add-model-sheet.tsx:1
  • web/frontend/src/components/models/edit-model-sheet.tsx has 779 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/frontend/src/components/models/edit-model-sheet.tsx:1
  • web/frontend/src/components/channels/channel-config-page.tsx has 700 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/frontend/src/components/channels/channel-config-page.tsx:1
  • web/frontend/src/components/config/form-model.ts has 498 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/frontend/src/components/config/form-model.ts:1
  • web/frontend/src/features/chat/controller.ts has 418 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/frontend/src/features/chat/controller.ts:1
  • web/frontend/src/components/chat/chat-page.tsx has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/frontend/src/components/chat/chat-page.tsx:1
  • web/frontend/src/components/channels/channel-forms/generic-form.tsx has 404 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/frontend/src/components/channels/channel-forms/generic-form.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 Coverage0.0 / 10Critical✓ 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.

  • 0% of 150 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count

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 package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

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

R7 · Dead Code0.0 / 10Critical✓ Tool-verified

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

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

  • Unreachable from the 12 application, 3 tooling and 0 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/models.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/models/models-page.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/models-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×4) — web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/edit-model-sheet.tsx, web/frontend/src/components/models/catalog-dialog.tsx, …
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/hooks/use-pico-chat.ts, web/frontend/src/routes/__root.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/features/chat/controller.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/index.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/chat/chat-page.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/credentials/credentials-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — web/frontend/src/hooks/use-credentials-page.ts, web/frontend/src/components/credentials/openai-credential-card.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-layout.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×3) — web/frontend/src/components/app-header.tsx, web/frontend/src/components/app-sidebar.tsx, web/frontend/src/components/tour/tour-guide.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/skills/skills-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×4) — web/frontend/src/components/agent/skills/use-skills-page.ts, web/frontend/src/components/agent/skills/detail-sheet.tsx, web/frontend/src/components/agent/skills/import-dialog.tsx, …
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×4) — web/frontend/src/components/chat/assistant-message.tsx, web/frontend/src/components/chat/chat-composer.tsx, web/frontend/src/features/chat/image-input.ts, …
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/logs/ansi-log-line.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/lib/ansi-log.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/web-search-tab.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — web/frontend/src/components/agent/tools/web-search-provider-settings.tsx, web/frontend/src/components/agent/tools/web-search-general-settings.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/tools-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — web/frontend/src/components/agent/tools/tool-library-tab.tsx, web/frontend/src/components/agent/tools/use-tools-page.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/provider-section.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/models/model-card.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/features/chat/controller.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×2) — web/frontend/src/features/chat/protocol.ts, web/frontend/src/features/chat/history.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-sidebar.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/hooks/use-sidebar-channels.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/edit-model-sheet.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×3) — web/frontend/src/components/models/fetch-models-dialog.tsx, web/frontend/src/components/models/test-model-dialog.tsx, web/frontend/src/components/models/provider-combobox.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/config.raw.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/config/raw-config-page.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 11 in-repo import(s) from 10 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/catalog-dialog.tsx, web/frontend/src/components/models/edit-model-sheet.tsx and 7 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/models/provider-registry.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-composer.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/chat/context-usage-ring.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/agent/skills.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/agent/skills/skills-page.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/credentials.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/components/credentials/credentials-page.tsx
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/features/chat/assistant-message-state.ts, web/frontend/src/features/chat/history.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/features/chat/tool-calls.ts
  • no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/features/chat/protocol.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/frontend/src/features/chat/assistant-message-state.ts

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

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.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

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

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

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

X2 · Cancellation propagation7.8 / 10Strong✓ Tool-verified

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

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

  • Only 33/52 functions that make a cancellable request (fetch, axios, ky, ofetch; 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.
  • `fetchGoogleUserEmail` 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, …)`. (×2) — cmd/picoclaw/internal/auth/helpers.go:237, web/backend/api/oauth.go:804
  • `fetchOpenAIModels` 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, …)`. — cmd/picoclaw/internal/model/online.go:24
  • `RequestDeviceCode` calls `http.Post(…)` 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, …)`. — REDACTED:251
  • `LoginDeviceCode` calls `http.Post(…)` 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, …)`. — REDACTED:342
  • `pollDeviceCode` calls `http.Post(…)` 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, …)`. — REDACTED:400
  • `RefreshAccessToken` calls `http.PostForm(…)` 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, …)`. — REDACTED:438
  • `ExchangeCodeForTokens` calls `http.PostForm(…)` 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, …)`. — REDACTED:531
  • `FetchAnthropicUsage` 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, …)`. — pkg/auth/anthropic_usage.go:27
  • `FetchAntigravityProjectID` 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, …)`. — REDACTED:506
  • `FetchAntigravityModels` 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, …)`. — REDACTED:554
  • `getWithRetry` calls `http.NewRequestWithContext(…)` 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, …)`. — REDACTED:37
  • `DownloadFile` 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, …)`. — pkg/utils/media.go:76
  • `probeTCPService` calls `dialer.DialContext(…)` 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, …)`. — web/backend/api/model_status.go:539
  • `getJSON` calls `http.NewRequestWithContext(…)` 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, …)`. — web/backend/api/model_status.go:616
  • `postLauncherDashboardLogin` 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/frontend/src/api/launcher-auth.ts:9
  • `getLauncherAuthStatus` 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/frontend/src/api/launcher-auth.ts:33
  • `postLauncherDashboardLogout` 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/frontend/src/api/launcher-auth.ts:44
  • `postLauncherDashboardSetup` 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/frontend/src/api/launcher-auth.ts:56

What to do

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

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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

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

X24 · Document value interpolated into markup unescaped2.7 / 10Weak✓ Tool-verified

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

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

  • `line` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/frontend/src/components/chat/message-code-block.tsx:209
  • `highlightedHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/frontend/src/components/chat/message-code-block.utils.ts:206

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

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.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

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

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

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

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

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

X3 · Exception handling6.6 / 10Adequate✓ Tool-verified

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

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

  • `if lastErr != 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. — cmd/membench/llm_client.go:159
  • `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. (×23) — cmd/membench/eval_llm.go:219, cmd/picoclaw/internal/mcp/helpers.go:261, cmd/picoclaw/internal/mcp/helpers.go:296, …
  • `if probeErr != 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. — cmd/picoclaw/internal/mcp/list.go:46
  • `if err := json.Unmarshal(raw, &messageIDs); 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. — pkg/channels/deltachat/handler.go:44
  • `if err := json.Unmarshal([]byte(content), &m); 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. — pkg/channels/feishu/common.go:49
  • `if err := json.Unmarshal(raw, &s); 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. — pkg/channels/feishu/common.go:57
  • `if err := json.Unmarshal([]byte(rawContent), &post); 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. — pkg/channels/feishu/common.go:76
  • `if err := json.Unmarshal(contentRaw, &rows); 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. — pkg/channels/feishu/common.go:85
  • `if err := json.Unmarshal(raw, &locale); 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. — pkg/channels/feishu/common.go:110
  • `if err := json.Unmarshal([]byte(rawContent), &card); 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. — pkg/channels/feishu/common.go:155
  • `if err := json.Unmarshal(raw, &msg); 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. — pkg/channels/pico/client.go:198
  • `if err := c.bc.Decode(&v); 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. — pkg/channels/vk/vk.go:60
  • `if err := json.Unmarshal(data, &raw); 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) — pkg/config/migration.go:114, pkg/config/migration.go:123
  • `if err := json.Unmarshal(objectData, &object); 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. — pkg/config/migration.go:131
  • `if err := json.Unmarshal(data, bc); 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. — pkg/config/defaults.go:611
  • `if err := json.Unmarshal(original, &originalMap); 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. — pkg/config/config_channel.go:266
  • `if err := json.Unmarshal(settings, &settingsMap); 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. — pkg/config/config_channel.go:275

What to do

  • Swallowed exception (caught, then discarded)
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.

X5 · Nullable reference types9.9 / 10Exemplary✓ Tool-verified

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

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

  • ~0.2 `!` null assertions per 1k TypeScript source lines — 4 assertion(s) across the 24537 source line(s) of the 151 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/frontend/src/components/agent/skills/use-skills-page.ts (1), web/frontend/src/components/models/add-model-sheet.tsx (1), web/frontend/src/components/models/edit-model-sheet.tsx (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

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

WCAG coverage — what static analysis assessed

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

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

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

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health50%Adequate — gated by D1, D2, R7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture83%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity81%StrongSolid.
Readiness48%Adequate — gated by D13, R4, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security63%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility44%Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance90%ExemplaryStrongest area.
Unscored — 4 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 16 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
Not included — 39 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — no exported interface declares behaviour
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 1 — a container did not start, exited, or never became healthy) — no service selected; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — 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.
  • D10 Test Quality — ~122599 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (pkg), 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 — No inline comments to assess — comment value is not applicable here.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.go), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 2 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.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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.
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 8 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 domain event(s); 8 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 — not scored — this repository shows only 1 of the 3 signals this lens looks for (8 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 and Scala, 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 — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • X27 Collection changed while being enumerated — 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
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

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 — 104 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 16 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <label> that labels no control · ×6
  • <label> that labels no control web/frontend/src/components/agent/tools/web-search-general-settings.tsx:126 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/frontend/src/components/agent/tools/web-search-provider-settings.tsx:273 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/frontend/src/components/config/config-sections.tsx:275 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/frontend/src/components/config/config-sections.tsx:293 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/frontend/src/components/config/config-sections.tsx:311 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/frontend/src/components/config/config-sections.tsx:338 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×3
  • Click handler on a non-interactive <div> web/frontend/src/components/agent/skills/import-dialog.tsx:106 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/frontend/src/components/chat/assistant-message.tsx:105 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/frontend/src/components/models/catalog-dialog.tsx:219 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
D13 · Secret Scanning · Leaked secret · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <button> with no accessible text · ×2
  • <button> with no accessible text web/frontend/src/components/agent/skills/filter-bar.tsx:105 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/frontend/src/components/agent/skills/filter-bar.tsx:117 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×2
  • REDACTED
  • REDACTED
AC2 · Forms & labels · Link with no accessible name · ×1
  • Link with no accessible name web/frontend/src/components/app-header.tsx:275 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×1
  • Hover-only interaction on <div> web/frontend/src/components/chat/context-usage-ring.tsx:85 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
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
Serious — 1291 finding(s)
D3 · God Classes · FunctionTooLong · ×57
  • FunctionTooLong: add-model-sheet.AddModelSheet web/frontend/src/components/models/add-model-sheet.tsx:107 — FunctionTooLong — AddModelSheet runs 617 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 517 over it, 6.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: models-page.ModelsPage web/frontend/src/components/models/models-page.tsx:466 — FunctionTooLong — ModelsPage runs 604 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 504 over it, 6.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: edit-model-sheet.EditModelSheet web/frontend/src/components/models/edit-model-sheet.tsx:114 — FunctionTooLong — EditModelSheet runs 600 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 500 over it, 6.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config-page.ConfigPage web/frontend/src/components/config/config-page.tsx:102 — FunctionTooLong — ConfigPage runs 587 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 487 over it, 5.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config.v0ProvidersMapToModelList pkg/config/config_old.go:32 — FunctionTooLong — v0ProvidersMapToModelList runs 385 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 285 over it, 3.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: channel-config-page.ChannelConfigPage web/frontend/src/components/channels/channel-config-page.tsx:290 — FunctionTooLong — ChannelConfigPage runs 374 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 274 over it, 3.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config.DefaultConfig pkg/config/defaults.go:16 — FunctionTooLong — DefaultConfig runs 317 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 217 over it, 3.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: use-credentials-page.useCredentialsPage web/frontend/src/hooks/use-credentials-page.ts:24 — FunctionTooLong — useCredentialsPage runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generic-form.GenericForm web/frontend/src/components/channels/channel-forms/generic-form.tsx:79 — FunctionTooLong — GenericForm runs 294 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 194 over it, 2.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chat-page.ChatPage web/frontend/src/components/chat/chat-page.tsx:103 — FunctionTooLong — ChatPage runs 272 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 172 over it, 2.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: wecom-form.WecomForm web/frontend/src/components/channels/channel-forms/wecom-form.tsx:43 — FunctionTooLong — WecomForm runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config-sections.MCPSection web/frontend/src/components/config/config-sections.tsx:533 — FunctionTooLong — MCPSection runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: app-header.AppHeader web/frontend/src/components/app-header.tsx:45 — FunctionTooLong — AppHeader runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.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: weixin-form.WeixinForm web/frontend/src/components/channels/channel-forms/weixin-form.tsx:57 — FunctionTooLong — WeixinForm runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: catalog-dialog.CatalogDialog web/frontend/src/components/models/catalog-dialog.tsx:45 — FunctionTooLong — CatalogDialog runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config-sections.AgentDefaultsSection web/frontend/src/components/config/config-sections.tsx:77 — FunctionTooLong — AgentDefaultsSection runs 251 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 151 over it, 2.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: main.main REDACTED:400 — FunctionTooLong — main runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: assistant-message.AssistantMessage web/frontend/src/components/chat/assistant-message.tsx:41 — FunctionTooLong — AssistantMessage 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: use-skills-page.useSkillsPage web/frontend/src/components/agent/skills/use-skills-page.ts:38 — FunctionTooLong — useSkillsPage runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: mqtt-form.MqttForm REDACTED:40 — FunctionTooLong — MqttForm runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: model-card.ModelCard web/frontend/src/components/models/model-card.tsx:32 — FunctionTooLong — ModelCard runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: providers.CreateProviderFromConfig pkg/providers/factory_provider.go:91 — FunctionTooLong — CreateProviderFromConfig runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: agent.registerSharedTools pkg/agent/agent_init.go:108 — FunctionTooLong — registerSharedTools 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: agent.NewAgentInstance pkg/agent/instance.go:91 — FunctionTooLong — NewAgentInstance runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: config.LoadConfig REDACTED:1293 — FunctionTooLong — LoadConfig runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 32 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×45
  • FileTooLong: integration/web.go pkg/tools/integration/web.go — FileTooLong — 1611 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1111 over it, 3.22× 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: channels/manager.go pkg/channels/manager.go — FileTooLong — 1323 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: Manager (41 blocks, 87-2130). The bar is 500 significant lines; this is 823 over it, 2.65× 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 — 1218 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 718 over it, 2.44× 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: telegram/telegram.go pkg/channels/telegram/telegram.go — FileTooLong — 1175 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: TelegramChannel (39 blocks, 52-1807). The bar is 500 significant lines; this is 675 over it, 2.35× 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 — 1136 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 636 over it, 2.27× 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/config-sections.tsx web/frontend/src/components/config/config-sections.tsx — FileTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 616 over it, 2.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1096 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Store (54 blocks, 14-1702). The bar is 500 significant lines; this is 596 over it, 2.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: api/models.go web/backend/api/models.go — FileTooLong — 1058 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 558 over it, 2.12× 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: api/gateway.go web/backend/api/gateway.go — FileTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 506 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 457 over it, 1.91× 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: models/models-page.tsx web/frontend/src/components/models/models-page.tsx — FileTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: ModelsPage (466-1224). The bar is 500 significant lines; this is 457 over it, 1.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: deltachat/deltachat.go pkg/channels/deltachat/deltachat.go — FileTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 350 over it, 1.70× 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: openclaw/openclaw_config.go pkg/migrate/sources/openclaw/openclaw_config.go — FileTooLong — 834 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 334 over it, 1.67× 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: fs/filesystem.go pkg/tools/fs/filesystem.go — FileTooLong — 818 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 318 over it, 1.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: FeishuChannel (33 blocks, 39-1266). The bar is 500 significant lines; this is 303 over it, 1.61× 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 — 802 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: WeixinChannel (16 blocks, 196-1157). 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: agent/context.go pkg/agent/context.go — FileTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: ContextBuilder (33 blocks, 24-1331). The bar is 500 significant lines; this is 288 over it, 1.58× 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: api/skills.go web/backend/api/skills.go — FileTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 274 over it, 1.55× 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: onebot/onebot.go pkg/channels/onebot/onebot.go — FileTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: OneBotChannel (23 blocks, 24-1132). The bar is 500 significant lines; this is 250 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: models/add-model-sheet.tsx web/frontend/src/components/models/add-model-sheet.tsx — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: AddModelSheet (107-846). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: models/edit-model-sheet.tsx web/frontend/src/components/models/edit-model-sheet.tsx — FileTooLong — 703 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: EditModelSheet (114-822). The bar is 500 significant lines; this is 203 over it, 1.41× 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: wecom/wecom.go pkg/channels/wecom/wecom.go — FileTooLong — 692 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: WeComChannel (32 blocks, 35-888). The bar is 500 significant lines; this is 192 over it, 1.38× 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-page.tsx web/frontend/src/components/config/config-page.tsx — FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: ConfigPage (102-872). The bar is 500 significant lines; this is 171 over it, 1.34× 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: api/session.go web/backend/api/session.go — FileTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 152 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: agent/hooks.go pkg/agent/hooks.go — FileTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 134 over it, 1.27× 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.
  • + 20 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×40
  • Swallowed exception (caught, then discarded) cmd/membench/llm_client.go:159 — `if lastErr != 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) cmd/membench/eval_llm.go:219 — `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) cmd/picoclaw/internal/mcp/list.go:46 — `if probeErr != 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) cmd/picoclaw/internal/mcp/helpers.go:261 — `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) cmd/picoclaw/internal/mcp/helpers.go:296 — `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) pkg/agent/subturn.go:473 — `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) pkg/agent/pipeline_execute.go:71 — `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) pkg/agent/model_resolution.go:72 — `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) pkg/agent/model_resolution.go:146 — `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) pkg/agent/instance.go:533 — `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) pkg/agent/discovery.go:248 — `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) pkg/agent/agent_media.go:208 — `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) REDACTED:72 — `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) REDACTED:390 — `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) REDACTED:611 — `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) REDACTED:45 — `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) pkg/channels/manager.go:1044 — `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) pkg/channels/deltachat/handler.go:44 — `if err := json.Unmarshal(raw, &messageIDs); 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) pkg/channels/deltachat/deltachat.go:1300 — `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) pkg/channels/deltachat/deltachat.go:1315 — `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) pkg/channels/feishu/common.go:49 — `if err := json.Unmarshal([]byte(content), &m); 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) pkg/channels/feishu/common.go:57 — `if err := json.Unmarshal(raw, &s); 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) pkg/channels/feishu/common.go:76 — `if err := json.Unmarshal([]byte(rawContent), &post); 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) pkg/channels/feishu/common.go:85 — `if err := json.Unmarshal(contentRaw, &rows); 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) pkg/channels/feishu/common.go:110 — `if err := json.Unmarshal(raw, &locale); 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.
  • + 15 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×29
  • Hotspot: pkg/agent/pipeline_llm.go pkg/agent/pipeline_llm.go:22 — pkg/agent/pipeline_llm.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 111 in Pipeline.CallLLM at line 22. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/pipeline_llm.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: REDACTED REDACTED:1293 — REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in config.LoadConfig at line 1293. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: pkg/tools/integration/web.go pkg/tools/integration/web.go:2099 — pkg/tools/integration/web.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in WebFetchTool.Execute at line 2099. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/tools/integration/web.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: pkg/agent/pipeline_execute.go pkg/agent/pipeline_execute.go:111 — pkg/agent/pipeline_execute.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in Pipeline.ExecuteTools at line 111. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/pipeline_execute.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: pkg/agent/agent_command.go pkg/agent/agent_command.go:127 — pkg/agent/agent_command.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in AgentLoop.buildCommandsRuntime at line 127. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/agent_command.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: pkg/providers/openai_compat/provider.go pkg/providers/openai_compat/provider.go:146 — pkg/providers/openai_compat/provider.go changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Provider.buildRequestBody at line 146. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/providers/openai_compat/provider.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: pkg/agent/agent_init.go pkg/agent/agent_init.go:108 — pkg/agent/agent_init.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in agent.registerSharedTools at line 108. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/agent_init.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: pkg/agent/instance.go pkg/agent/instance.go:91 — pkg/agent/instance.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in agent.NewAgentInstance at line 91. 2 of those changes were fix/bug commits, and the other 2 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/instance.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/frontend/src/components/config/config-page.tsx web/frontend/src/components/config/config-page.tsx:102 — web/frontend/src/components/config/config-page.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in config-page.ConfigPage at line 102. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- web/frontend/src/components/config/config-page.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: pkg/agent/turn_coord.go pkg/agent/turn_coord.go:17 — pkg/agent/turn_coord.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in AgentLoop.runTurn at line 17. 1 of those changes was a fix/bug commit, and the other 2 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/turn_coord.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/frontend/src/components/chat/chat-page.tsx web/frontend/src/components/chat/chat-page.tsx:103 — web/frontend/src/components/chat/chat-page.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in chat-page.ChatPage at line 103. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- web/frontend/src/components/chat/chat-page.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: REDACTED REDACTED:400 — REDACTED changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in main.main at line 400. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: pkg/providers/factory_provider.go pkg/providers/factory_provider.go:91 — pkg/providers/factory_provider.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in providers.CreateProviderFromConfig at line 91. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/providers/factory_provider.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/frontend/src/components/app-header.tsx web/frontend/src/components/app-header.tsx:45 — web/frontend/src/components/app-header.tsx changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in app-header.AppHeader at line 45. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- web/frontend/src/components/app-header.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: pkg/agent/pipeline_setup.go pkg/agent/pipeline_setup.go:16 — pkg/agent/pipeline_setup.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in Pipeline.SetupTurn at line 16. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/pipeline_setup.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: pkg/tools/cron.go pkg/tools/cron.go:312 — pkg/tools/cron.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in CronTool.updateJob at line 312. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/tools/cron.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: pkg/gateway/gateway.go pkg/gateway/gateway.go:120 — pkg/gateway/gateway.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in gateway.Run at line 120. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/gateway/gateway.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: pkg/agent/agent_media.go pkg/agent/agent_media.go:60 — pkg/agent/agent_media.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in agent.resolveMediaRefs at line 60. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/agent_media.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: pkg/agent/llm_media.go pkg/agent/llm_media.go:122 — pkg/agent/llm_media.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in Pipeline.routeMediaTurn at line 122. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/llm_media.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: pkg/utils/media.go pkg/utils/media.go:76 — pkg/utils/media.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in utils.DownloadFile at line 76. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/utils/media.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/frontend/src/components/chat/chat-composer.tsx web/frontend/src/components/chat/chat-composer.tsx:47 — web/frontend/src/components/chat/chat-composer.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in chat-composer.ChatComposer at line 47. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- web/frontend/src/components/chat/chat-composer.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: pkg/providers/anthropic/provider.go pkg/providers/anthropic/provider.go:141 — pkg/providers/anthropic/provider.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in anthropicprovider.buildParams at line 141. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/providers/anthropic/provider.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: pkg/tools/toolloop.go pkg/tools/toolloop.go:43 — pkg/tools/toolloop.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in tools.RunToolLoop at line 43. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/tools/toolloop.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: pkg/providers/error_classifier.go pkg/providers/error_classifier.go:151 — pkg/providers/error_classifier.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in providers.ClassifyError at line 151. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/providers/error_classifier.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/backend/api/config.go web/backend/api/config.go:134 — web/backend/api/config.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Handler.handlePatchConfig at line 134. 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-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- web/backend/api/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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×28
  • Duplicated block (8 lines × 2) cmd/membench/main.go:63 — cmd/membench/main.go:63-70 | cmd/membench/main.go:96-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) pkg/agent/pipeline_setup.go:23 — pkg/agent/pipeline_setup.go:23-30 | pkg/agent/pipeline_setup.go:65-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) pkg/channels/manager.go:1415 — pkg/channels/manager.go:1415-1422 | pkg/channels/manager.go:1922-1929 — 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 `pkg/channels/manager.go:1415` 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) pkg/config/config_struct.go:65 — pkg/config/config_struct.go:65-72 | web/backend/api/config.go:586-593 — 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 `pkg/config/config_struct.go:65` 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) pkg/config/migration.go:216 — pkg/config/migration.go:216-223 | pkg/config/migration.go:296-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) pkg/gateway/gateway.go:433 — pkg/gateway/gateway.go:433-440 | pkg/gateway/gateway.go:681-688 — 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 `pkg/gateway/gateway.go:433` 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) pkg/providers/httpapi/gemini_provider.go:195 — pkg/providers/httpapi/gemini_provider.go:195-202 | pkg/providers/openai_compat/provider.go:597-604 — 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 `pkg/providers/httpapi/gemini_provider.go:195` 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) REDACTED:519 — REDACTED:519-526 | REDACTED:563-570 — 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:519` 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) pkg/tools/cron.go:611 — pkg/tools/cron.go:611-618 | pkg/tools/cron.go:635-642 — 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 `pkg/tools/cron.go:611` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) REDACTED:116 — REDACTED:116-123 | REDACTED:173-180 — 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:116` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) pkg/tools/shell.go:824 — pkg/tools/shell.go:824-831 | pkg/tools/shell.go:1088-1095 — 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 `pkg/tools/shell.go:824` 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 (8 lines × 2) REDACTED:299 — REDACTED:299-306 | REDACTED:319-326 — 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:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) web/backend/utils/runtime.go:72 — web/backend/utils/runtime.go:72-79 | web/backend/utils/runtime.go:104-111 — 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 `web/backend/utils/runtime.go:72` 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) REDACTED:572 — REDACTED:572-579 | pkg/channels/slack/slack.go:241-248 — 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) pkg/pid/pidfile.go:39 — pkg/pid/pidfile.go:39-46 | web/backend/api/pico.go:303-310 — 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) pkg/auth/store.go:189 — pkg/auth/store.go:189-198 | web/backend/api/model_catalog.go:91-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.
  • Duplicated block (8 lines × 2) web/backend/api/wecom.go:389 — web/backend/api/wecom.go:389-396 | web/backend/api/weixin.go:289-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) pkg/audio/asr/elevenlabs_transcriber.go:105 — pkg/audio/asr/elevenlabs_transcriber.go:105-112 | pkg/audio/asr/whisper_transcriber.go:202-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/audio/asr/elevenlabs_transcriber.go:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) web/backend/api/oauth.go:221 — web/backend/api/oauth.go:221-228 | web/backend/api/oauth.go:482-489 — 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 `web/backend/api/oauth.go: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.
  • Duplicated block (8 lines × 2) pkg/channels/deltachat/deltachat.go:371 — pkg/channels/deltachat/deltachat.go:371-378 | REDACTED:763-770 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:458 — REDACTED:458-465 | REDACTED:554-561 — 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:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) REDACTED:1365 — REDACTED:1365-1372 | REDACTED:1406-1413 — 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:1365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) pkg/tools/shell.go:420 — pkg/tools/shell.go:420-427 | pkg/tools/shell.go:586-593 — 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 `pkg/tools/shell.go:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) web/backend/api/models.go:1298 — web/backend/api/models.go:1298-1305 | web/backend/api/models.go:1404-1411 — 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 `web/backend/api/models.go:1298` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) web/backend/api/skills.go:174 — web/backend/api/skills.go:174-181 | web/backend/api/skills.go:287-294 — 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.
  • + 3 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×27
  • MethodTooLong: Pipeline.ExecuteTools pkg/agent/pipeline_execute.go:111 — MethodTooLong — ExecuteTools runs 553 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 453 over it, 5.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pipeline.CallLLM pkg/agent/pipeline_llm.go:22 — MethodTooLong — CallLLM runs 510 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 410 over it, 5.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: Runtime.RunColdPathOnce REDACTED:240 — MethodTooLong — RunColdPathOnce runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.buildCommandsRuntime pkg/agent/agent_command.go:127 — MethodTooLong — buildCommandsRuntime runs 205 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.askSideQuestion pkg/agent/turn_coord.go:365 — MethodTooLong — askSideQuestion runs 196 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.runTurn pkg/agent/turn_coord.go:17 — MethodTooLong — runTurn runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: converter.walk pkg/utils/markdown.go:138 — MethodTooLong — walk runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WebSearchToolOptions.providerByName pkg/tools/integration/web.go:1655 — MethodTooLong — providerByName runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentLoop.ensureMCPInitialized pkg/agent/agent_mcp.go:78 — MethodTooLong — ensureMCPInitialized runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WebFetchTool.Execute pkg/tools/integration/web.go:2099 — MethodTooLong — Execute 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: ReadFileLinesTool.Execute pkg/tools/fs/filesystem.go:536 — MethodTooLong — Execute runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.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.
  • MethodTooLong: InstallSkillTool.Execute pkg/tools/integration/skills_install.go:76 — MethodTooLong — Execute runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pipeline.SetupTurn pkg/agent/pipeline_setup.go:16 — MethodTooLong — SetupTurn runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DeltaChatChannel.handleMessage pkg/channels/deltachat/handler.go:60 — MethodTooLong — handleMessage runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Handler.handleInstallSkill web/backend/api/skills.go:285 — MethodTooLong — handleInstallSkill runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pipeline.tryConfiguredStreamingLLM pkg/agent/pipeline_streaming.go:17 — MethodTooLong — tryConfiguredStreamingLLM runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: LINEChannel.processEvent pkg/channels/line/line.go:179 — MethodTooLong — processEvent runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: TelegramChannel.handleMessages pkg/channels/telegram/telegram.go:1036 — MethodTooLong — handleMessages runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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: DiscordChannel.receiveVoice pkg/channels/discord/voice.go:141 — MethodTooLong — receiveVoice runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: Handler.handleOAuthLogin web/backend/api/oauth.go:173 — MethodTooLong — handleOAuthLogin runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: OneBotChannel.handleMessage pkg/channels/onebot/onebot.go:931 — MethodTooLong — handleMessage runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.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.
  • MethodTooLong: ContextBuilder.BuildMessagesFromPrompt pkg/agent/context.go:842 — MethodTooLong — BuildMessagesFromPrompt runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Assembler.Assemble pkg/seahorse/short_assembler.go:38 — MethodTooLong — Assemble runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Handler.handleUpdateModel web/backend/api/models.go:742 — MethodTooLong — handleUpdateModel runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DiscordChannel.handleMessage pkg/channels/discord/discord.go:524 — MethodTooLong — handleMessage 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×27
  • Duplicated block (11 lines × 2) cmd/picoclaw/internal/auth/helpers.go:239 — cmd/picoclaw/internal/auth/helpers.go:239-249 | web/backend/api/oauth.go:806-816 — 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/auth/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (11 lines × 2) cmd/picoclaw/internal/auth/wecom.go:363 — cmd/picoclaw/internal/auth/wecom.go:363-373 | web/backend/api/wecom.go:310-320 — 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/auth/wecom.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (11 lines × 2) pkg/agent/turn_context.go:82 — pkg/agent/turn_context.go:82-92 | pkg/routing/route.go:139-149 — 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) pkg/audio/tts/mimo_tts.go:109 — pkg/audio/tts/mimo_tts.go:109-119 | pkg/audio/tts/openai_tts.go:179-189 — 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 (11 lines × 2) pkg/auth/token.go:12 — pkg/auth/token.go:12-22 | pkg/auth/token.go:36-46 — 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) REDACTED:310 — REDACTED:310-320 | REDACTED:1076-1086 — 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:310` 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) pkg/channels/manager.go:2045 — pkg/channels/manager.go:2045-2055 | pkg/channels/manager.go:2084-2094 — 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) REDACTED:1377 — REDACTED:1377-1387 | REDACTED:1418-1428 — 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:1377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/migrate/migrate.go:211 — pkg/migrate/migrate.go:211-221 | pkg/migrate/migrate.go:223-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) pkg/providers/openai_compat/provider.go:473 — pkg/providers/openai_compat/provider.go:473-483 | pkg/providers/openai_compat/provider.go:544-554 — 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 after the matched lines, `pkg/providers/openai_compat/provider.go:555` calls `Set` and `pkg/providers/openai_compat/provider.go:484` 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 (11 lines × 2) pkg/routing/agent_id.go:30 — pkg/routing/agent_id.go:30-40 | pkg/routing/agent_id.go:52-62 — 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 `pkg/routing/agent_id.go:30` 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) REDACTED:1411 — REDACTED:1411-1421 | REDACTED:1569-1579 — 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) pkg/tools/cron.go:297 — pkg/tools/cron.go:297-307 | pkg/tools/cron.go:314-324 — 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) pkg/tools/integration/web.go:489 — pkg/tools/integration/web.go:489-499 | pkg/tools/integration/web.go:1448-1458 — 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 `pkg/tools/integration/web.go:489` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/tools/shell.go:816 — pkg/tools/shell.go:816-826 | pkg/tools/shell.go:855-865 — 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) web/backend/api/oauth.go:322 — web/backend/api/oauth.go:322-332 | web/backend/api/oauth.go:339-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. 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) web/backend/api/skills.go:119 — web/backend/api/skills.go:119-129 | web/backend/api/skills.go:138-148 — 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) web/backend/api/wecom.go:233 — web/backend/api/wecom.go:233-243 | web/backend/api/weixin.go:233-243 — 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 `web/backend/api/wecom.go:233` 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) pkg/agent/agent_utils.go:412 — pkg/agent/agent_utils.go:412-422 | pkg/utils/http_retry.go:105-115 — 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 (11 lines × 2) pkg/channels/deltachat/handler.go:384 — pkg/channels/deltachat/handler.go:384-394 | REDACTED:343-353 — 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 (11 lines × 2) web/backend/api/wecom.go:377 — web/backend/api/wecom.go:377-387 | web/backend/api/weixin.go:277-287 — 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 (11 lines × 2) cmd/picoclaw/internal/auth/helpers.go:49 — cmd/picoclaw/internal/auth/helpers.go:49-60 | cmd/picoclaw/internal/auth/helpers.go:197-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/picoclaw/internal/auth/helpers.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/netbind/netbind.go:263 — pkg/netbind/netbind.go:263-273 | pkg/netbind/netbind.go:279-289 — 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 `pkg/netbind/netbind.go:263` 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) REDACTED:64 — REDACTED:64-74 | REDACTED:93-103 — 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) pkg/tools/integration/web.go:326 — pkg/tools/integration/web.go:326-336 | pkg/tools/integration/web.go:459-469 — 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 `pkg/tools/integration/web.go:326` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×27
  • Duplicated block (10 lines × 2) cmd/membench/eval.go:57 — cmd/membench/eval.go:57-66 | cmd/membench/eval_llm.go:144-153 — 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 `cmd/membench/eval.go:57` 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) pkg/agent/hooks.go:326 — pkg/agent/hooks.go:326-335 | pkg/agent/hooks.go:358-367 — 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 `pkg/agent/hooks.go:326` 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) pkg/agent/hooks.go:470 — pkg/agent/hooks.go:470-479 | pkg/agent/hooks.go:508-517 — 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 `pkg/agent/hooks.go:470` 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) pkg/agent/pipeline_llm.go:402 — pkg/agent/pipeline_llm.go:402-411 | pkg/agent/pipeline_setup.go:60-69 — 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 `pkg/agent/pipeline_llm.go:402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/evolution/drafts.go:68 — pkg/evolution/drafts.go:68-77 | pkg/evolution/skills_recall.go:19-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) pkg/providers/httpapi/gemini_provider.go:74 — pkg/providers/httpapi/gemini_provider.go:74-83 | pkg/providers/httpapi/gemini_provider.go:141-150 — 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) pkg/providers/httpapi/gemini_provider.go:162 — pkg/providers/httpapi/gemini_provider.go:162-171 | pkg/providers/openai_compat/provider.go:567-576 — 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. 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) pkg/providers/httpapi/gemini_provider.go:482 — pkg/providers/httpapi/gemini_provider.go:482-491 | REDACTED:381-390 — 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 `pkg/providers/httpapi/gemini_provider.go:482` 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) pkg/seahorse/short_engine.go:336 — pkg/seahorse/short_engine.go:336-345 | pkg/seahorse/short_engine.go:352-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) web/backend/api/gateway.go:56 — web/backend/api/gateway.go:56-65 | web/backend/api/gateway.go:1149-1158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) web/backend/api/oauth.go:186 — web/backend/api/oauth.go:186-195 | web/backend/api/oauth.go:466-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. 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) web/backend/api/session.go:244 — web/backend/api/session.go:244-253 | web/backend/api/session.go:260-269 — 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 `web/backend/api/session.go:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) web/backend/api/skills.go:557 — web/backend/api/skills.go:557-566 | web/backend/api/skills.go:576-586 — 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 `web/backend/api/skills.go:557` 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) pkg/agent/agent_utils.go:226 — pkg/agent/agent_utils.go:226-236 | pkg/providers/httpapi/gemini_provider.go:776-785 — 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) REDACTED:238 — REDACTED:238-247 | web/backend/utils/runtime.go:90-100 — 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) pkg/routing/route.go:267 — pkg/routing/route.go:267-276 | pkg/session/key.go:127-136 — 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) pkg/tools/spawn.go:20 — pkg/tools/spawn.go:20-29 | pkg/tools/subagent.go:347-356 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) cmd/picoclaw/internal/auth/helpers.go:61 — cmd/picoclaw/internal/auth/helpers.go:61-72 | cmd/picoclaw/internal/auth/helpers.go:302-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/picoclaw/internal/auth/helpers.go:61` 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) cmd/picoclaw/internal/cliui/mcp_show.go:92 — cmd/picoclaw/internal/cliui/mcp_show.go:92-101 | pkg/commands/handler_mcp.go:80-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. Check import visibility before settling on that home: `cmd/picoclaw/internal/cliui/mcp_show.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (10 lines × 2) cmd/picoclaw/internal/auth/helpers.go:208 — cmd/picoclaw/internal/auth/helpers.go:208-217 | cmd/picoclaw/internal/auth/helpers.go:284-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/picoclaw/internal/auth/helpers.go:208` 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) pkg/tools/shell.go:777 — pkg/tools/shell.go:777-786 | pkg/tools/shell.go:1070-1079 — 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 `pkg/tools/shell.go:777` 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) pkg/tools/integration/web.go:482 — pkg/tools/integration/web.go:482-491 | pkg/tools/integration/web.go:1348-1357 — 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 `pkg/tools/integration/web.go:482` 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) REDACTED:1394 — REDACTED:1394-1403 | REDACTED:1552-1561 — 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) pkg/tools/cron.go:383 — pkg/tools/cron.go:383-392 | pkg/tools/cron.go:570-579 — 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 `pkg/tools/cron.go:383` 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) pkg/tools/integration/message.go:197 — pkg/tools/integration/message.go:197-206 | pkg/tools/integration/reaction.go:51-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/tools/integration/reaction.go:62` calls `ToolMessageID` and `pkg/tools/integration/message.go:208` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×18
  • Duplicated block (7 lines × 2) cmd/membench/llm_client.go:121 — cmd/membench/llm_client.go:121-127 | cmd/membench/llm_client.go:142-148 — 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) pkg/agent/hooks.go:446 — pkg/agent/hooks.go:446-452 | pkg/agent/turn_state.go:768-774 — 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 `pkg/agent/hooks.go:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pkg/channels/split.go:92 — pkg/channels/split.go:92-99 | pkg/channels/split.go:115-121 — 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 `pkg/channels/split.go:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) pkg/config/config_struct.go:644 — pkg/config/config_struct.go:644-650 | pkg/config/security.go:131-138 — 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 `pkg/config/config_struct.go:644` 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) pkg/memory/jsonl.go:312 — pkg/memory/jsonl.go:312-318 | pkg/memory/jsonl.go:861-867 — 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 `pkg/memory/jsonl.go:312` 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, `pkg/memory/jsonl.go:319` calls `Printf`, `Name` and `pkg/memory/jsonl.go:868` 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 (7 lines × 2) pkg/providers/anthropic_messages/provider.go:198 — pkg/providers/anthropic_messages/provider.go:198-204 | pkg/providers/anthropic_messages/provider.go:276-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/providers/anthropic_messages/provider.go:198` 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) web/backend/api/config.go:37 — web/backend/api/config.go:37-43 | web/backend/api/tools.go:407-413 — 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) web/backend/api/models.go:963 — web/backend/api/models.go:963-969 | web/backend/api/tools.go:234-240 — 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 `web/backend/api/models.go:963` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cmd/picoclaw/internal/skills/helpers.go:135 — cmd/picoclaw/internal/skills/helpers.go:135-141 | web/backend/api/skills.go:741-747 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Check import visibility before settling on that home: `cmd/picoclaw/internal/skills/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (7 lines × 2) pkg/channels/onebot/onebot.go:1121 — pkg/channels/onebot/onebot.go:1121-1127 | REDACTED:1258-1264 — 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) pkg/channels/slack_webhook/convert.go:242 — pkg/channels/slack_webhook/convert.go:242-248 | pkg/channels/teams_webhook/teams_webhook.go:399-406 — 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:174 — REDACTED:174-180 | REDACTED:337-343 — 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) pkg/audio/asr/elevenlabs_transcriber.go:114 — pkg/audio/asr/elevenlabs_transcriber.go:114-120 | pkg/audio/asr/whisper_transcriber.go:211-217 — 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 `pkg/audio/asr/elevenlabs_transcriber.go:114` 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) pkg/netbind/netbind.go:519 — pkg/netbind/netbind.go:519-525 | pkg/netbind/netbind.go:554-560 — 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 `pkg/netbind/netbind.go:519` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) pkg/providers/httpapi/gemini_provider.go:85 — pkg/providers/httpapi/gemini_provider.go:85-91 | pkg/providers/httpapi/gemini_provider.go:152-158 — 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) pkg/channels/slack_webhook/slack_webhook.go:46 — pkg/channels/slack_webhook/slack_webhook.go:46-52 | pkg/channels/teams_webhook/teams_webhook.go:76-82 — 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 `pkg/channels/slack_webhook/slack_webhook.go:46` 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) pkg/channels/telegram/telegram.go:1405 — pkg/channels/telegram/telegram.go:1405-1411 | pkg/channels/telegram/telegram.go:1432-1438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) REDACTED:82 — REDACTED:82-88 | REDACTED:111-117 — 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:82` 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.
D31 · IaC & Container Security · Medium IaC · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×15
  • Duplicated block (12 lines × 2) cmd/picoclaw/internal/mcp/helpers.go:336 — cmd/picoclaw/internal/mcp/helpers.go:336-347 | cmd/picoclaw/internal/mcp/show.go:39-50 — 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 `cmd/picoclaw/internal/mcp/helpers.go:336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 2) cmd/picoclaw/internal/mcp/show.go:101 — cmd/picoclaw/internal/mcp/show.go:101-112 | pkg/agent/agent_command.go:455-466 — 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 `cmd/picoclaw/internal/mcp/show.go:101` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/show.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (12 lines × 2) cmd/picoclaw/internal/mcp/show.go:149 — cmd/picoclaw/internal/mcp/show.go:149-160 | cmd/picoclaw/internal/mcp/test.go:17-28 — 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 `cmd/picoclaw/internal/mcp/show.go:149` 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) cmd/picoclaw/internal/skills/helpers.go:328 — cmd/picoclaw/internal/skills/helpers.go:328-339 | pkg/migrate/internal/common.go:101-112 — 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 `cmd/picoclaw/internal/skills/helpers.go:328` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/skills/helpers.go`, `pkg/migrate/internal/common.go` sit under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (12 lines × 2) pkg/agent/hook_mount.go:270 — pkg/agent/hook_mount.go:270-281 | web/backend/api/gateway.go:663-674 — 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 `pkg/agent/hook_mount.go:270` 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) pkg/agent/hooks.go:370 — pkg/agent/hooks.go:370-381 | pkg/agent/hooks.go:520-531 — 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 `pkg/agent/hooks.go:370` 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 (12 lines × 2) pkg/channels/onebot/onebot.go:520 — pkg/channels/onebot/onebot.go:520-531 | pkg/channels/onebot/onebot.go:588-599 — 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 `pkg/channels/onebot/onebot.go:520` 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) pkg/memory/jsonl.go:693 — pkg/memory/jsonl.go:693-704 | pkg/memory/jsonl.go:756-767 — 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 (12 lines × 2) REDACTED:166 — REDACTED:166-177 | REDACTED:266-277 — 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) web/backend/api/launcher_config.go:58 — web/backend/api/launcher_config.go:58-69 | web/backend/api/launcher_config.go:98-109 — 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 `web/backend/api/launcher_config.go:58` 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 (12 lines × 2) web/backend/api/models.go:768 — web/backend/api/models.go:768-779 | web/backend/api/models.go:1082-1093 — 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 `web/backend/api/models.go:768` 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. 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) cmd/picoclaw/internal/skills/helpers.go:143 — cmd/picoclaw/internal/skills/helpers.go:143-154 | pkg/tools/integration/skills_install.go:297-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Check import visibility before settling on that home: `cmd/picoclaw/internal/skills/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (12 lines × 2) REDACTED:608 — REDACTED:608-619 | web/backend/api/session.go:102-113 — 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 (12 lines × 2) pkg/providers/fallback.go:150 — pkg/providers/fallback.go:150-162 | pkg/providers/fallback.go:307-318 — 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 `pkg/providers/fallback.go:150` 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) pkg/channels/slack/slack.go:370 — pkg/channels/slack/slack.go:370-381 | pkg/channels/telegram/telegram.go:1090-1101 — 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.
X2 · Cancellation propagation · Function without context.Context · ×15
  • Function without context.Context: fetchGoogleUserEmail cmd/picoclaw/internal/auth/helpers.go:237 — `fetchGoogleUserEmail` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: fetchOpenAIModels cmd/picoclaw/internal/model/online.go:24 — `fetchOpenAIModels` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: RequestDeviceCode REDACTED:251 — `RequestDeviceCode` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: LoginDeviceCode REDACTED:342 — `LoginDeviceCode` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: pollDeviceCode REDACTED:400 — `pollDeviceCode` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: RefreshAccessToken REDACTED:438 — `RefreshAccessToken` calls `http.PostForm(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: ExchangeCodeForTokens REDACTED:531 — `ExchangeCodeForTokens` calls `http.PostForm(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: FetchAnthropicUsage pkg/auth/anthropic_usage.go:27 — `FetchAnthropicUsage` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: FetchAntigravityProjectID REDACTED:506 — `FetchAntigravityProjectID` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: FetchAntigravityModels REDACTED:554 — `FetchAntigravityModels` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: getWithRetry REDACTED:37 — `getWithRetry` calls `http.NewRequestWithContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: DownloadFile pkg/utils/media.go:76 — `DownloadFile` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: fetchGoogleUserEmail web/backend/api/oauth.go:804 — `fetchGoogleUserEmail` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: probeTCPService web/backend/api/model_status.go:539 — `probeTCPService` calls `dialer.DialContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
  • Function without context.Context: getJSON web/backend/api/model_status.go:616 — `getJSON` calls `http.NewRequestWithContext(…)` 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, …)`.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×14
  • Duplicated block (9 lines × 2) cmd/membench/eval.go:286 — cmd/membench/eval.go:286-294 | cmd/membench/eval.go:354-362 — 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) cmd/membench/eval_llm.go:169 — cmd/membench/eval_llm.go:169-177 | cmd/membench/eval_llm.go:306-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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/membench/eval_llm.go:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) cmd/picoclaw/internal/auth/helpers.go:244 — cmd/picoclaw/internal/auth/helpers.go:244-252 | REDACTED:524-532 — 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 `cmd/picoclaw/internal/auth/helpers.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. 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/auth/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:520` calls `Set` and `cmd/picoclaw/internal/auth/helpers.go:242` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/agent/model_resolution.go:170 — pkg/agent/model_resolution.go:170-178 | web/backend/api/gateway.go:642-650 — 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 `pkg/agent/model_resolution.go:170` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) pkg/auth/anthropic_usage.go:36 — pkg/auth/anthropic_usage.go:36-44 | REDACTED:568-576 — 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 `pkg/auth/anthropic_usage.go:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:564` calls `Set` and `pkg/auth/anthropic_usage.go:32` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) pkg/channels/deltachat/init.go:12 — pkg/channels/deltachat/init.go:12-20 | pkg/channels/irc/init.go:12-20 — 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 `pkg/channels/deltachat/init.go:12` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/channels/whatsapp/init.go:13 — pkg/channels/whatsapp/init.go:13-21 | pkg/channels/whatsapp_native/init.go:15-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:254 — REDACTED:254-262 | REDACTED:91-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:254` 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 (9 lines × 2) REDACTED:128 — REDACTED:128-136 | REDACTED:184-192 — 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:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/tools/shell.go:611 — pkg/tools/shell.go:611-619 | pkg/tools/shell.go:650-660 — 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 `pkg/tools/shell.go:611` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) web/backend/api/config.go:72 — web/backend/api/config.go:72-80 | web/backend/api/config.go:192-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `web/backend/api/config.go:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/credential/credential.go:179 — pkg/credential/credential.go:179-187 | pkg/credential/credential.go:216-224 — 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 `pkg/credential/credential.go:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) REDACTED:1169 — REDACTED:1169-1177 | REDACTED:1225-1233 — 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:1169` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) REDACTED:1095 — REDACTED:1095-1103 | REDACTED:1127-1135 — 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:1095` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1091` calls `invalidateTokenOnAuthError` and `REDACTED:1123` 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.
D3 · God Classes · TooManyMethods · ×12
  • TooManyMethods: Handler web/backend/api/router.go:12 — TooManyMethods — 146 methods, declared across 18 files: api/gateway.go (18), api/oauth.go (15), api/session.go (14), api/models.go (12), +14 more file(s). The bar is 30 methods; this is 116 over it, 4.87× 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: AgentLoop pkg/agent/agent.go:34 — TooManyMethods — 104 methods, declared across 20 files: agent/steering.go (18), agent/agent_inject.go (10), agent/agent_event.go (9), agent/agent_message.go (9), +16 more file(s). The bar is 30 methods; this is 74 over it, 3.47× 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: Store REDACTED:14 — TooManyMethods — 53 methods. The bar is 30 methods; this is 23 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.
  • TooManyMethods: Manager pkg/channels/manager.go:87 — TooManyMethods — 47 methods, declared across 2 files: channels/manager.go (40), channels/events.go (7). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TelegramChannel pkg/channels/telegram/telegram.go:52 — TooManyMethods — 41 methods, declared across 2 files: telegram/telegram.go (39), REDACTED (2). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: turnState pkg/agent/turn_state.go:191 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PicoChannel REDACTED:96 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WeComChannel pkg/channels/wecom/wecom.go:35 — TooManyMethods — 37 methods, declared across 2 files: wecom/wecom.go (32), REDACTED (5). The bar is 30 methods; this is 7 over it, 1.23× 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: DeltaChatChannel pkg/channels/deltachat/deltachat.go:144 — TooManyMethods — 36 methods, declared across 2 files: deltachat/deltachat.go (31), deltachat/handler.go (5). The bar is 30 methods; this is 6 over it, 1.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: FeishuChannel REDACTED:39 — TooManyMethods — 36 methods, declared across 3 files: REDACTED (32), feishu/feishu_reply.go (3), feishu/common.go (1). The bar is 30 methods; this is 6 over it, 1.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: ContextBuilder pkg/agent/context.go:24 — TooManyMethods — 33 methods, declared across 2 files: agent/context.go (32), agent/definition.go (1). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DiscordChannel pkg/channels/discord/discord.go:40 — TooManyMethods — 32 methods, declared across 2 files: discord/discord.go (28), discord/voice.go (4). The bar is 30 methods; this is 2 over it, 1.07× 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.
D3 · God Classes · ClassTooLong · ×12
  • ClassTooLong: Store REDACTED:14 — ClassTooLong — 1012 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods, 54 blocks, lines 14-1702. The bar is 400 significant lines; this is 612 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Manager pkg/channels/manager.go:87 — ClassTooLong — 918 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods, 41 blocks, lines 87-2130. The bar is 400 significant lines; this is 518 over it, 2.30× 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: TelegramChannel pkg/channels/telegram/telegram.go:52 — ClassTooLong — 806 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods, 39 blocks, lines 52-1807. The bar is 400 significant lines; this is 406 over it, 2.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FeishuChannel REDACTED:39 — ClassTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods, 33 blocks, lines 39-1266. The bar is 400 significant lines; this is 291 over it, 1.73× 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: OneBotChannel pkg/channels/onebot/onebot.go:24 — ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods, 23 blocks, lines 24-1132. The bar is 400 significant lines; this is 246 over it, 1.62× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Runtime REDACTED:39 — ClassTooLong — 603 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods, 18 blocks, lines 39-1567. The bar is 400 significant lines; this is 203 over it, 1.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ContextBuilder pkg/agent/context.go:24 — ClassTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods, 33 blocks, lines 24-1331. The bar is 400 significant lines; this is 169 over it, 1.42× 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: PicoChannel REDACTED:96 — ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods, 37 blocks, lines 96-1491. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WeComChannel pkg/channels/wecom/wecom.go:35 — ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods, 32 blocks, lines 35-888. The bar is 400 significant lines; this is 128 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DiscordChannel pkg/channels/discord/discord.go:40 — ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods, 29 blocks, lines 40-990. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DeltaChatChannel pkg/channels/deltachat/deltachat.go:144 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods, 32 blocks, lines 144-1274. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: QQChannel pkg/channels/qq/qq.go:57 — ClassTooLong — 465 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods, 23 blocks, lines 57-1022. The bar is 400 significant lines; this is 65 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×11
  • Duplicated block (13 lines × 2) cmd/membench/main.go:131 — cmd/membench/main.go:131-143 | cmd/membench/main.go:169-181 — 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 (13 lines × 2) cmd/picoclaw/internal/auth/wecom.go:348 — cmd/picoclaw/internal/auth/wecom.go:348-360 | web/backend/api/wecom.go:295-307 — 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/auth/wecom.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (13 lines × 2) cmd/picoclaw/internal/mcp/show.go:72 — cmd/picoclaw/internal/mcp/show.go:72-84 | pkg/agent/agent_command.go:425-437 — 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 `cmd/picoclaw/internal/mcp/show.go:72` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/show.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (13 lines × 2) pkg/channels/slack/slack.go:606 — pkg/channels/slack/slack.go:606-618 | pkg/channels/slack/slack.go:621-633 — 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. 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) REDACTED:171 — REDACTED:171-183 | REDACTED:243-255 — 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:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (13 lines × 2) pkg/providers/httpapi/types.go:9 — pkg/providers/httpapi/types.go:9-21 | pkg/providers/types.go:10-22 — before extracting anything, compare `pkg/providers/httpapi/types.go` and `pkg/providers/types.go` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/providers/httpapi/types.go:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:225 — REDACTED:225-237 | REDACTED:279-291 — 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:279` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) REDACTED:1656 — REDACTED:1656-1668 | REDACTED:1683-1695 — 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, `REDACTED:1654` calls `Errorf` and `REDACTED:1682` 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) pkg/tools/integration/mcp_tool.go:378 — pkg/tools/integration/mcp_tool.go:378-390 | pkg/tools/integration/mcp_tool.go:392-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) pkg/channels/discord/discord.go:286 — pkg/channels/discord/discord.go:286-298 | pkg/channels/matrix/matrix.go:496-508 — 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 `pkg/channels/discord/discord.go:286` 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) pkg/channels/discord/discord.go:286 — pkg/channels/discord/discord.go:286-298 | pkg/channels/telegram/telegram.go:678-690 — 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 `pkg/channels/discord/discord.go:286` 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.
D17 · Explicit Debt · TodoComment · ×10
  • TodoComment pkg/agent/pipeline.go:23 — // TODO: *Steering — 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 pkg/agent/agent.go:295 — // TODO: Re-enable media cleanup after inbound media is properly consumed by the agent. — 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 pkg/audio/asr/asr.go:42 — // TODO: Further restrict this by modelID, since not every model under these — 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 pkg/events/subscription.go:239 — // TODO: replace this with keyed executors when runtime events need — 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 pkg/logger/logger.go:55 — // TODO: make it configurable??? — 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 pkg/providers/factory_test.go:261 — // TODO: Test custom APIBase when createClaudeAuthProvider supports it — 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 pkg/providers/factory_test.go:265 — // TODO: This test requires openai protocol to support auth_method: "oauth" — 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 pkg/providers/cli/github_copilot_provider.go:29 — // TODO: Implement stdio mode for GitHub Copilot provider — 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 pkg/tools/subagent.go:175 — // TODO(eventbus): once subagents are modeled as child turns inside — 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 pkg/tools/integration/mcp_tool.go:452 — // TODO: Add lifecycle cleanup/retention for MCP artifact files. — 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • Duplicated block (6 lines × 2) cmd/picoclaw/internal/cron/helpers.go:21 — cmd/picoclaw/internal/cron/helpers.go:21-26 | pkg/tools/cron.go:278-283 — 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 `cmd/picoclaw/internal/cron/helpers.go:21` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/cron/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (6 lines × 2) pkg/config/security.go:111 — pkg/config/security.go:111-116 | pkg/config/security.go:128-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/config/security.go:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) cmd/picoclaw/internal/helpers.go:20 — cmd/picoclaw/internal/helpers.go:20-25 | web/backend/utils/runtime.go:23-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Check import visibility before settling on that home: `cmd/picoclaw/internal/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (6 lines × 2) pkg/channels/telegram/parser_markdown_to_html.go:175 — pkg/channels/telegram/parser_markdown_to_html.go:175-180 | pkg/skills/loader.go:382-387 — 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 (6 lines × 2) pkg/memory/jsonl.go:101 — pkg/memory/jsonl.go:101-106 | pkg/session/manager.go:186-191 — 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 (6 lines × 2) pkg/channels/manager.go:1871 — pkg/channels/manager.go:1871-1876 | pkg/mcp/manager.go:498-504 — 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 (6 lines × 2) web/backend/api/wecom.go:370 — web/backend/api/wecom.go:370-375 | web/backend/api/weixin.go:270-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) pkg/tools/fs/filesystem.go:1129 — pkg/tools/fs/filesystem.go:1129-1135 | pkg/tools/fs/filesystem.go:1216-1221 — 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 `pkg/tools/fs/filesystem.go:1129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/channels/line/line.go:235 — pkg/channels/line/line.go:235-240 | pkg/channels/line/line.go:253-258 — 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 `pkg/channels/line/line.go:235` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/netbind/netbind.go:511 — pkg/netbind/netbind.go:511-516 | pkg/netbind/netbind.go:546-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/netbind/netbind.go:511` 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 (5 lines × 2) · ×9
  • Duplicated block (5 lines × 2) pkg/agent/pipeline_setup.go:41 — pkg/agent/pipeline_setup.go:41-45 | pkg/agent/pipeline_setup.go:87-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) REDACTED:495 — REDACTED:495-499 | REDACTED:725-729 — 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 `REDACTED:495` 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 (5 lines × 2) pkg/gateway/gateway.go:448 — pkg/gateway/gateway.go:448-452 | pkg/gateway/gateway.go:696-700 — 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 `pkg/gateway/gateway.go:448` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) REDACTED:1645 — REDACTED:1645-1649 | REDACTED:1675-1679 — 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:1645` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) web/backend/api/auth.go:150 — web/backend/api/auth.go:150-154 | web/backend/api/auth.go:293-297 — 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 (5 lines × 2) web/backend/api/models.go:783 — web/backend/api/models.go:783-787 | web/backend/api/models.go:927-932 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) pkg/agent/agent_outbound.go:131 — pkg/agent/agent_outbound.go:131-135 | pkg/agent/agent_outbound.go:274-284 — 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 `pkg/agent/agent_outbound.go:131` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `modelName` in one and `channelID` 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 (5 lines × 2) pkg/gateway/gateway.go:443 — pkg/gateway/gateway.go:443-447 | pkg/gateway/gateway.go:691-695 — 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 `pkg/gateway/gateway.go:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:184 — REDACTED:184-188 | REDACTED:1318-1322 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:184` 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.
AC2 · Forms & labels · <Select> field component without a label · ×6
  • <Select> field component without a label web/frontend/src/components/agent/skills/filter-bar.tsx:56 — 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.
  • <Select> field component without a label web/frontend/src/components/agent/skills/filter-bar.tsx:74 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. 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.
  • <Select> field component without a label web/frontend/src/components/agent/tools/tool-library-tab.tsx:83 — 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.
  • <Select> field component without a label web/frontend/src/components/chat/model-selector.tsx:42 — 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.
  • <Select> field component without a label web/frontend/src/components/config/config-sections.tsx:92 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. 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.
  • <Select> field component without a label web/frontend/src/components/logs/log-level-select.tsx:84 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) pkg/bus/outbound_context.go:70 — pkg/bus/outbound_context.go:70-84 | pkg/session/scope.go:18-32 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) pkg/channels/manager.go:1230 — pkg/channels/manager.go:1230-1244 | pkg/channels/manager.go:1953-1967 — 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 `pkg/channels/manager.go:1230` 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, `pkg/channels/manager.go:1245` calls `Errorf` and `pkg/channels/manager.go:1968` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) pkg/channels/manager.go:1587 — pkg/channels/manager.go:1587-1601 | pkg/channels/manager.go:1782-1796 — 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 `pkg/channels/manager.go:1587` 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 (15 lines × 2) pkg/channels/onebot/onebot.go:429 — pkg/channels/onebot/onebot.go:429-443 | pkg/channels/onebot/onebot.go:540-554 — 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 `pkg/channels/onebot/onebot.go:429` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15 lines × 2) REDACTED:408 — REDACTED:408-422 | REDACTED:472-486 — 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:408` 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) web/backend/api/models.go:1273 — web/backend/api/models.go:1273-1287 | web/backend/api/models.go:1320-1334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `web/backend/api/models.go:1273` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×6
  • Duplicated block (9 lines × 3) pkg/agent/agent_utils.go:53 — pkg/agent/agent_utils.go:53-61 | pkg/bus/outbound_context.go:74-82 | pkg/session/scope.go:22-30 — 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.
  • Duplicated block (9 lines × 3) pkg/providers/azure/provider.go:197 — pkg/providers/azure/provider.go:197-205 | pkg/providers/httpapi/gemini_provider.go:93-101 | pkg/providers/openai_compat/provider.go:492-500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 3) pkg/agent/registry.go:82 — pkg/agent/registry.go:82-90 | pkg/channels/manager.go:1892-1901 | pkg/session/manager.go:171-179 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 3) web/backend/api/wecom.go:398 — web/backend/api/wecom.go:398-406 | web/backend/api/wecom.go:408-416 | web/backend/api/weixin.go:298-306 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The matched lines also 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `botID` in one and `errMsg` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) pkg/channels/discord/discord.go:281 — pkg/channels/discord/discord.go:281-289 | pkg/channels/slack/slack.go:193-201 | pkg/channels/telegram/telegram.go:673-681 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/channels/discord/discord.go:281` 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 (9 lines × 3) pkg/tools/integration/web.go:366 — pkg/tools/integration/web.go:366-374 | pkg/tools/integration/web.go:483-491 | pkg/tools/integration/web.go:1349-1357 — 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 `pkg/tools/integration/web.go:366` 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×6
  • Outbound HTTP without resilience REDACTED:256 — `http.Post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:347 — `http.Post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:406 — `http.Post(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:458 — `http.PostForm(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience REDACTED:554 — `http.PostForm(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience pkg/mcp/manager.go:380 — `http.Client{` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×6
  • Duplicated block (17 lines × 2 locations) web/frontend/src/components/channels/channel-forms/generic-form.tsx:62 — web/frontend/src/components/channels/channel-forms/generic-form.tsx:62 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:29 — 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/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:59 — web/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:59 · web/frontend/src/components/channels/channel-forms/streaming-config-field.tsx:76 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (17 lines × 2 locations) web/frontend/src/components/chat/message-code-block.utils.ts:128 — web/frontend/src/components/chat/message-code-block.utils.ts:128 · web/frontend/src/components/chat/message-code-block.utils.ts:262 — 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 (17 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:273 — web/frontend/src/components/config/config-sections.tsx:273 · web/frontend/src/components/config/config-sections.tsx:290 — 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 (17 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:781 — web/frontend/src/components/config/config-sections.tsx:781 · web/frontend/src/components/config/config-sections.tsx:814 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (17 lines × 2 locations) web/frontend/src/components/config/form-model.ts:446 — web/frontend/src/components/config/form-model.ts:446 · web/frontend/src/components/config/form-model.ts:464 — 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×5
  • Animation without a prefers-reduced-motion guard web/frontend/src/components/chat/typing-indicator.tsx:26 — <span> 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/frontend/src/components/chat/typing-indicator.tsx:27 — <span> 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/frontend/src/components/chat/typing-indicator.tsx:28 — <span> 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/frontend/src/components/chat/typing-indicator.tsx:32 — <div> moves — its `animate-[shimmer_2s_infinite]` 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/frontend/src/components/chat/typing-indicator.tsx:35 — <p> moves — its `animate-[fadeSlideIn_0.4s_ease-out]` 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:.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) pkg/channels/deltachat/deltachat.go:710 — pkg/channels/deltachat/deltachat.go:710-723 | REDACTED:225-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/channels/deltachat/deltachat.go:710` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/channels/pico/client.go:212 — pkg/channels/pico/client.go:212-225 | REDACTED:1160-1173 — 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 `pkg/channels/pico/client.go:212` 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 (14 lines × 2) pkg/channels/qq/qq.go:623 — pkg/channels/qq/qq.go:623-636 | pkg/channels/qq/qq.go:692-705 — 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 `pkg/channels/qq/qq.go:623` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) REDACTED:422 — REDACTED:422-435 | REDACTED:487-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:422` 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 (14 lines × 2) pkg/providers/httpapi/gemini_provider.go:118 — pkg/providers/httpapi/gemini_provider.go:118-131 | pkg/providers/openai_compat/provider.go:514-527 — 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 `pkg/providers/httpapi/gemini_provider.go:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×5
  • Duplicated block (7 lines × 3) pkg/channels/onebot/onebot.go:321 — pkg/channels/onebot/onebot.go:321-327 | pkg/channels/onebot/onebot.go:437-443 | pkg/channels/onebot/onebot.go:548-554 — 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 `pkg/channels/onebot/onebot.go:321` 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 × 3) pkg/tools/integration/web.go:820 — pkg/tools/integration/web.go:820-826 | pkg/tools/integration/web.go:1324-1331 | pkg/tools/integration/web.go:1420-1427 — 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 `pkg/tools/integration/web.go:820` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 3) pkg/channels/discord/discord.go:439 — pkg/channels/discord/discord.go:439-445 | pkg/channels/matrix/matrix.go:710-716 | pkg/channels/telegram/telegram.go:560-566 — 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.
  • Duplicated block (7 lines × 3) pkg/tools/fs/edit.go:19 — pkg/tools/fs/edit.go:19-25 | pkg/tools/fs/edit.go:83-89 | pkg/tools/fs/filesystem.go:994-1000 — 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.
  • Duplicated block (7 lines × 3) web/backend/api/model_catalog.go:165 — web/backend/api/model_catalog.go:165-171 | web/backend/api/models.go:963-969 | web/backend/api/tools.go:234-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `web/backend/api/model_catalog.go:165` 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.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×5
  • Duplicated block (14 lines × 2 locations) web/frontend/src/api/gateway.ts:26 — web/frontend/src/api/gateway.ts:26 · web/frontend/src/api/pico.ts:15 — 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 (14 lines × 2 locations) REDACTED:83 — REDACTED:83 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:83 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (14 lines × 2 locations) web/frontend/src/components/channels/channel-forms/slack-form.tsx:21 — web/frontend/src/components/channels/channel-forms/slack-form.tsx:21 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:46 — 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 (14 lines × 2 locations) web/frontend/src/components/chat/chat-empty-state.tsx:39 — web/frontend/src/components/chat/chat-empty-state.tsx:39 · web/frontend/src/components/chat/chat-empty-state.tsx:55 — 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 (14 lines × 2 locations) web/frontend/src/components/credentials/antigravity-credential-card.tsx:62 — web/frontend/src/components/credentials/antigravity-credential-card.tsx:62 · web/frontend/src/components/credentials/openai-credential-card.tsx:70 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFields · ×4
  • TooManyFields: turnState pkg/agent/turn_state.go:191 — TooManyFields — 52 stored fields beside 39 methods. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: WebSearchToolOptions pkg/tools/integration/web.go:1466 — TooManyFields — 36 stored fields beside 5 methods. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AgentLoop pkg/agent/agent.go:34 — TooManyFields — 33 stored fields beside 104 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: LearningRecord pkg/evolution/types.go:72 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) REDACTED:860 — REDACTED:860-877 | web/backend/api/session.go:661-678 — 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 `REDACTED:860` 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 (18 lines × 2) pkg/providers/factory_provider.go:120 — pkg/providers/factory_provider.go:120-137 | pkg/providers/factory_provider.go:209-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/providers/factory_provider.go:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) pkg/tools/integration/helpers.go:25 — pkg/tools/integration/helpers.go:25-42 | pkg/tools/normalization.go:86-103 — before extracting anything, compare `pkg/tools/integration/helpers.go` and `pkg/tools/normalization.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 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.
  • Duplicated block (18 lines × 2) pkg/tools/integration/web.go:1304 — pkg/tools/integration/web.go:1304-1321 | pkg/tools/integration/web.go:1400-1417 — 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 `pkg/tools/integration/web.go:1304` 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 (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) cmd/membench/eval.go:72 — cmd/membench/eval.go:72-87 | cmd/membench/eval.go:179-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/membench/eval.go:72` 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 (16 lines × 2) pkg/agent/pipeline_streaming.go:355 — pkg/agent/pipeline_streaming.go:355-370 | REDACTED:195-210 — 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 `pkg/agent/pipeline_streaming.go:355` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:193` calls `ValueOf` and `pkg/agent/pipeline_streaming.go:353` 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 (16 lines × 2) pkg/channels/manager.go:372 — pkg/channels/manager.go:372-387 | pkg/channels/manager.go:516-531 — 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 (16 lines × 2) REDACTED:46 — REDACTED:46-61 | REDACTED:69-84 — 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:46` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×4
  • Duplicated block (10–11 lines × 2) cmd/picoclaw/internal/skills/helpers.go:349 — cmd/picoclaw/internal/skills/helpers.go:349-358 | pkg/migrate/internal/common.go:149-159 — 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 `pkg/migrate/internal/common.go:149` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Check import visibility before settling on that home: `cmd/picoclaw/internal/skills/helpers.go`, `pkg/migrate/internal/common.go` sit under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/picoclaw/internal/skills/helpers.go:347` calls `Close` and `pkg/migrate/internal/common.go:147` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 2) pkg/channels/weixin/api.go:47 — pkg/channels/weixin/api.go:47-57 | pkg/providers/common/common.go:50-59 — 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 `pkg/channels/weixin/api.go:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) pkg/config/config_struct.go:395 — pkg/config/config_struct.go:395-405 | pkg/config/config_struct.go:602-611 — 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 `pkg/config/config_struct.go:395` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) pkg/providers/anthropic_messages/provider.go:205 — pkg/providers/anthropic_messages/provider.go:205-214 | pkg/providers/anthropic_messages/provider.go:283-293 — 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 `pkg/providers/anthropic_messages/provider.go:205` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×4
  • Duplicated block (8 lines × 3) web/backend/api/models.go:722 — web/backend/api/models.go:722-729 | web/backend/api/models.go:960-967 | web/backend/api/models.go:1056-1063 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) cmd/picoclaw/internal/mcp/helpers.go:204 — cmd/picoclaw/internal/mcp/helpers.go:204-211 | pkg/config/config_struct.go:697-704 | pkg/config/config_struct.go:706-713 — 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (8 lines × 3) pkg/audio/tts/mimo_tts.go:122 — pkg/audio/tts/mimo_tts.go:122-129 | pkg/providers/anthropic_messages/provider.go:116-124 | REDACTED:113-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/audio/tts/mimo_tts.go:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 3) pkg/agent/agent_outbound.go:176 — pkg/agent/agent_outbound.go:176-183 | pkg/agent/agent_outbound.go:207-214 | pkg/agent/agent_outbound.go:243-250 — 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 `pkg/agent/agent_outbound.go:176` 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.
X2 · Cancellation propagation · Async function without AbortSignal · ×4
  • Async function without AbortSignal: postLauncherDashboardLogin web/frontend/src/api/launcher-auth.ts:9 — `postLauncherDashboardLogin` 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: getLauncherAuthStatus web/frontend/src/api/launcher-auth.ts:33 — `getLauncherAuthStatus` 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: postLauncherDashboardLogout web/frontend/src/api/launcher-auth.ts:44 — `postLauncherDashboardLogout` 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: postLauncherDashboardSetup web/frontend/src/api/launcher-auth.ts:56 — `postLauncherDashboardSetup` 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 })`.
AC2 · Forms & labels · <Textarea> field component without a label · ×3
  • <Textarea> field component without a label web/frontend/src/components/config/config-sections.tsx:324 — 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/frontend/src/components/config/config-sections.tsx:351 — 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/frontend/src/components/config/raw-config-page.tsx:160 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: factory_provider.go ↔ models.ts pkg/providers/factory_provider.go:1 — `pkg/providers/factory_provider.go` and `web/frontend/src/api/models.ts` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `cd7717bc` feat(tool): tool schema semplification; `38a498e2` feat(provider): support custom headers injection for HTTP providers (…; `79df9386` Use getter/setter methods for API key access in ModelConfig — run `git show` on any of them.
  • Change coupling: models.go ↔ edit-model-sheet.tsx web/backend/api/models.go:1 — `web/backend/api/models.go` and `web/frontend/src/components/models/edit-model-sheet.tsx` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `30938df4` fix(web): use stored API key when fetching models for saved providers…; `604187e3` feat(web,api): test connection with real connectivity verification (#…; `cd7717bc` feat(tool): tool schema semplification — run `git show` on any of them.
  • Change coupling: REDACTED ↔ models.ts REDACTED:1 — `REDACTED` and `web/frontend/src/api/models.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `cd7717bc` feat(tool): tool schema semplification; `38a498e2` feat(provider): support custom headers injection for HTTP providers (…; `be6bf9f6` Add virtual model support for multi-key expansion — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×3
  • Duplicated block (30 lines × 2) REDACTED:252 — REDACTED:252-281 | REDACTED:343-372 — 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 (30 lines × 2) REDACTED:1032 — REDACTED:1032-1061 | REDACTED:1129-1158 — 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:1032` 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 (30 lines × 2) pkg/tools/integration/helpers.go:45 — pkg/tools/integration/helpers.go:45-74 | pkg/tools/normalization.go:106-135 — before extracting anything, compare `pkg/tools/integration/helpers.go` and `pkg/tools/normalization.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 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 (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) pkg/channels/onebot/onebot.go:400 — pkg/channels/onebot/onebot.go:400-413 | pkg/channels/onebot/onebot.go:455-467 | pkg/channels/whatsapp_native/whatsapp_native.go:411-422 — 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.
  • Duplicated block (12 lines × 3) pkg/tools/shell.go:746 — pkg/tools/shell.go:746-757 | pkg/tools/shell.go:775-786 | pkg/tools/shell.go:850-861 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/tools/shell.go:788` calls `Read` and `pkg/tools/shell.go:759` 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 (12 lines × 3) web/backend/api/models.go:914 — web/backend/api/models.go:914-925 | web/backend/api/models.go:1025-1036 | web/backend/api/models.go:1084-1095 — 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 `web/backend/api/models.go:914` 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 · ×3
  • Low cohesion: Handler (LCOM4 12) web/backend/api/router.go:12 — Handler's methods fall into 12 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 12 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: finalizeHookStreamer (LCOM4 4) pkg/channels/manager.go:912 — finalizeHookStreamer's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Config (LCOM4 4) REDACTED:35 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×2
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/channels/discord/discord.go:452 — pkg/channels/discord/discord.go:452-462 | REDACTED:402-412 | pkg/channels/matrix/matrix.go:723-733 | pkg/channels/telegram/telegram.go:573-583 — 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) web/backend/api/models.go:742 — web/backend/api/models.go:742-905 | web/backend/api/models.go:910-969 | web/backend/api/models.go:1006-1068 | web/backend/api/models.go:1073-1117 — 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 · Duplicated block (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) pkg/tools/fs/filesystem.go:835 — pkg/tools/fs/filesystem.go:835-862 | pkg/tools/integration/helpers.go:107-134 — 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 (28 lines × 2) pkg/tools/integration/helpers.go:77 — pkg/tools/integration/helpers.go:77-104 | pkg/tools/normalization.go:265-292 — before extracting anything, compare `pkg/tools/integration/helpers.go` and `pkg/tools/normalization.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 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) · ×2
  • Duplicated block (22 lines × 2) pkg/agent/agent_utils.go:376 — pkg/agent/agent_utils.go:376-397 | pkg/memory/jsonl.go:150-171 — 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 (22 lines × 2) pkg/agent/definition.go:206 — pkg/agent/definition.go:206-227 | pkg/skills/loader.go:359-380 — 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 (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) pkg/isolation/runtime.go:365 — pkg/isolation/runtime.go:365-385 | pkg/isolation/runtime.go:392-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (21 lines × 2) pkg/providers/httpapi/types.go:35 — pkg/providers/httpapi/types.go:35-55 | pkg/providers/types.go:45-65 — before extracting anything, compare `pkg/providers/httpapi/types.go` and `pkg/providers/types.go` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) pkg/channels/onebot/onebot.go:400 — pkg/channels/onebot/onebot.go:400-417 | pkg/channels/onebot/onebot.go:455-471 — 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 (17–18 lines × 2) pkg/channels/slack_webhook/slack_webhook.go:101 — pkg/channels/slack_webhook/slack_webhook.go:101-117 | pkg/channels/teams_webhook/teams_webhook.go:134-151 — 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 `pkg/channels/slack_webhook/slack_webhook.go:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) pkg/tools/integration/web.go:311 — pkg/tools/integration/web.go:311-325 | pkg/tools/integration/web.go:444-458 | pkg/tools/integration/web.go:1143-1157 — 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 `pkg/tools/integration/web.go:311` 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, `pkg/tools/integration/web.go:1140` calls `Set` and `pkg/tools/integration/web.go:308` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) pkg/tools/shell.go:627 — pkg/tools/shell.go:627-641 | pkg/tools/shell.go:663-677 | pkg/tools/shell.go:683-697 — 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 `pkg/tools/shell.go:627` 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 (13–15 lines × 2) · ×2
  • Duplicated block (13–15 lines × 2) pkg/channels/slack_webhook/convert.go:251 — pkg/channels/slack_webhook/convert.go:251-263 | pkg/channels/teams_webhook/teams_webhook.go:411-425 — 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–15 lines × 2) pkg/skills/clawhub_registry.go:378 — pkg/skills/clawhub_registry.go:378-390 | pkg/utils/download.go:39-53 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/utils/download.go:55` calls `DebugCF` and `pkg/skills/clawhub_registry.go:392` 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 (14–15 lines × 2) · ×2
  • Duplicated block (14–15 lines × 2) REDACTED:331 — REDACTED:331-344 | REDACTED:399-413 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:398` calls `ToLower`, `Ext` and `REDACTED:330` 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 (14–15 lines × 2) pkg/utils/context.go:63 — pkg/utils/context.go:63-77 | pkg/utils/context.go:132-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) pkg/providers/anthropic_messages/provider.go:239 — pkg/providers/anthropic_messages/provider.go:239-251 | pkg/providers/bedrock/provider_bedrock.go:645-656 — 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 `pkg/providers/anthropic_messages/provider.go:239` 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, `pkg/providers/bedrock/provider_bedrock.go:657` calls `Printf` and `pkg/providers/anthropic_messages/provider.go:252` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–13 lines × 2) web/backend/api/config.go:53 — web/backend/api/config.go:53-64 | web/backend/api/config.go:135-147 — 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) REDACTED:182 — REDACTED:182-193 | web/backend/api/tools.go:545-555 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) pkg/tools/integration/web.go:816 — pkg/tools/integration/web.go:816-826 | pkg/tools/integration/web.go:1320-1331 — 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 `pkg/tools/integration/web.go:816` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) REDACTED:502 — REDACTED:502-511 | REDACTED:519-528 | REDACTED:531-540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) pkg/agent/turn_context.go:53 — pkg/agent/turn_context.go:53-62 | pkg/bus/inbound_context.go:67-77 | pkg/providers/httpapi/gemini_provider.go:787-796 — 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.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×2
  • Duplicated block (21 lines × 2 locations) web/frontend/src/api/system.ts:25 — web/frontend/src/api/system.ts:25 · web/frontend/src/api/tools.ts:47 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (21 lines × 2 locations) REDACTED:178 — REDACTED:178 · REDACTED:199 — 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 × 2 locations) · ×2
  • Duplicated block (18 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:754 — web/frontend/src/components/config/config-sections.tsx:754 · web/frontend/src/components/config/config-sections.tsx:823 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (18 lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx:213 — web/frontend/src/components/models/add-model-sheet.tsx:213 · web/frontend/src/components/models/edit-model-sheet.tsx:200 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:207 — web/frontend/src/components/config/config-sections.tsx:207 · web/frontend/src/components/config/config-sections.tsx:445 — 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 (15 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:942 — web/frontend/src/components/config/config-sections.tsx:942 · web/frontend/src/components/config/config-sections.tsx:959 — 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.
R11 · Import Boundaries · Boundary violation [package · ×2
  • Boundary violation [package:third-party-deep-import] web/frontend/src/components/chat/message-code-block.tsx:7 — web/frontend/src/components/chat/message-code-block.tsx:7 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/frontend/src/components/chat/message-code-block.tsx:8 — web/frontend/src/components/chat/message-code-block.tsx:8 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.
R7 · Dead Code · Dead file (~251 LoC) · ×2
  • Dead file (~251 LoC) web/frontend/src/components/models/model-card.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/provider-section.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~251 LoC) web/frontend/src/features/chat/protocol.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/features/chat/controller.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~195 LoC) · ×2
  • Dead file (~195 LoC) web/frontend/src/components/models/provider-registry.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 11 in-repo import(s) from 10 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/catalog-dialog.tsx, web/frontend/src/components/models/edit-model-sheet.tsx and 7 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~195 LoC) web/frontend/src/components/models/test-model-dialog.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/edit-model-sheet.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~160 LoC) · ×2
  • Dead file (~160 LoC) web/frontend/src/components/agent/skills/import-dialog.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/skills/skills-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~160 LoC) web/frontend/src/components/agent/skills/skills-page.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/agent/skills.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~122 LoC) · ×2
  • Dead file (~122 LoC) web/frontend/src/features/chat/assistant-message-state.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/features/chat/protocol.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
  • Dead file (~122 LoC) web/frontend/src/features/chat/history.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/features/chat/controller.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×2
  • Untrusted text written into markup unescaped web/frontend/src/components/chat/message-code-block.tsx:209 — `line` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/frontend/src/components/chat/message-code-block.utils.ts:206 — `highlightedHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
AC6 · Visual & motion safety · Focus outline removed inline · ×1
  • Focus outline removed inline web/frontend/src/components/agent/tools/tools-tabs.tsx:36 — <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).
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 109 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · config.v0ProvidersMapToModelList (cyclomatic 212) · ×1
  • config.v0ProvidersMapToModelList (cyclomatic 212) pkg/config/config_old.go:32 — config.v0ProvidersMapToModelList has cyclomatic complexity 212 (threshold 15). Most of this is not in the body itself: 12 of the 212 points are its own statements and the rest belongs to 25 function literals inside it that branch (lines 46, 73, 97, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Pipeline.ExecuteTools (cyclomatic 112) · ×1
  • Pipeline.ExecuteTools (cyclomatic 112) pkg/agent/pipeline_execute.go:111 — Pipeline.ExecuteTools has cyclomatic complexity 112 (threshold 15). Of this number, 107 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pipeline.CallLLM (cyclomatic 111) · ×1
  • Pipeline.CallLLM (cyclomatic 111) pkg/agent/pipeline_llm.go:22 — Pipeline.CallLLM has cyclomatic complexity 111 (threshold 15). Of this number, 93 points are the body's own statements and 18 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 · models-page.ModelsPage (cyclomatic 99) · ×1
  • models-page.ModelsPage (cyclomatic 99) web/frontend/src/components/models/models-page.tsx:466 — models-page.ModelsPage has cyclomatic complexity 99 (threshold 15). Of this number, 33 points are the body's own statements and 66 belong to 17 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 · converter.walk (cyclomatic 70) · ×1
  • converter.walk (cyclomatic 70) pkg/utils/markdown.go:138 — converter.walk has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.main (cyclomatic 60) · ×1
  • main.main (cyclomatic 60) REDACTED:400 — main.main has cyclomatic complexity 60 (threshold 15). Of this number, 55 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into 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-config-page.ChannelConfigPage (cyclomatic 60) · ×1
  • channel-config-page.ChannelConfigPage (cyclomatic 60) web/frontend/src/components/channels/channel-config-page.tsx:290 — channel-config-page.ChannelConfigPage has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 11 of the 60 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 323, renderForm, handleSave, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · providers.CreateProviderFromConfig (cyclomatic 56) · ×1
  • providers.CreateProviderFromConfig (cyclomatic 56) pkg/providers/factory_provider.go:91 — providers.CreateProviderFromConfig has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · app-header.AppHeader (cyclomatic 49) · ×1
  • app-header.AppHeader (cyclomatic 49) web/frontend/src/components/app-header.tsx:45 — app-header.AppHeader has cyclomatic complexity 49 (threshold 15). Of this number, 39 points are the body's own statements and 10 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 · generic-form.GenericForm (cyclomatic 49) · ×1
  • generic-form.GenericForm (cyclomatic 49) web/frontend/src/components/channels/channel-forms/generic-form.tsx:79 — generic-form.GenericForm has cyclomatic complexity 49 (threshold 15). Of this number, 33 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · model-card.ModelCard (cyclomatic 49) · ×1
  • model-card.ModelCard (cyclomatic 49) web/frontend/src/components/models/model-card.tsx:32 — model-card.ModelCard has cyclomatic complexity 49 (threshold 15). Of this number, 40 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentLoop.runTurn (cyclomatic 47) · ×1
  • AgentLoop.runTurn (cyclomatic 47) pkg/agent/turn_coord.go:17 — AgentLoop.runTurn has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentLoop.askSideQuestion (cyclomatic 47) · ×1
  • AgentLoop.askSideQuestion (cyclomatic 47) pkg/agent/turn_coord.go:365 — AgentLoop.askSideQuestion has cyclomatic complexity 47 (threshold 15). Of this number, 36 points are the body's own statements and 11 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent.registerSharedTools (cyclomatic 47) · ×1
  • agent.registerSharedTools (cyclomatic 47) pkg/agent/agent_init.go:108 — agent.registerSharedTools has cyclomatic complexity 47 (threshold 15). Of this number, 33 points are the body's own statements and 14 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenClawConfig.convertChannels (cyclomatic 45) · ×1
  • OpenClawConfig.convertChannels (cyclomatic 45) pkg/migrate/sources/openclaw/openclaw_config.go:773 — OpenClawConfig.convertChannels has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · assistant-message.AssistantMessage (cyclomatic 45) · ×1
  • assistant-message.AssistantMessage (cyclomatic 45) web/frontend/src/components/chat/assistant-message.tsx:41 — assistant-message.AssistantMessage has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AgentLoop.buildCommandsRuntime (cyclomatic 44) · ×1
  • AgentLoop.buildCommandsRuntime (cyclomatic 44) pkg/agent/agent_command.go:127 — AgentLoop.buildCommandsRuntime has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 5 of the 44 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 302, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · Runtime.RunColdPathOnce (cyclomatic 44) · ×1
  • Runtime.RunColdPathOnce (cyclomatic 44) REDACTED:240 — Runtime.RunColdPathOnce has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WebSearchToolOptions.providerByName (cyclomatic 43) · ×1
  • WebSearchToolOptions.providerByName (cyclomatic 43) pkg/tools/integration/web.go:1655 — WebSearchToolOptions.providerByName has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Engine.Bootstrap (cyclomatic 40) · ×1
  • Engine.Bootstrap (cyclomatic 40) pkg/seahorse/short_engine.go:417 — Engine.Bootstrap has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · channels.hiddenValues (cyclomatic 39) · ×1
  • channels.hiddenValues (cyclomatic 39) REDACTED:43 — channels.hiddenValues has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.LoadConfig (cyclomatic 39) · ×1
  • config.LoadConfig (cyclomatic 39) REDACTED:1293 — config.LoadConfig has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadFileLinesTool.Execute (cyclomatic 39) · ×1
  • ReadFileLinesTool.Execute (cyclomatic 39) pkg/tools/fs/filesystem.go:536 — ReadFileLinesTool.Execute has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · updater.findAssetInfo (cyclomatic 39) · ×1
  • updater.findAssetInfo (cyclomatic 39) REDACTED:214 — updater.findAssetInfo has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 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 · catalog-dialog.CatalogDialog (cyclomatic 39) · ×1
  • catalog-dialog.CatalogDialog (cyclomatic 39) web/frontend/src/components/models/catalog-dialog.tsx:45 — catalog-dialog.CatalogDialog has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 204, handleAddSelected, a function literal at line 62, …). 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 · agent.NewAgentInstance (cyclomatic 38) · ×1
  • agent.NewAgentInstance (cyclomatic 38) pkg/agent/instance.go:91 — agent.NewAgentInstance has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Manager.preSend (cyclomatic 38) · ×1
  • Manager.preSend (cyclomatic 38) pkg/channels/manager.go:370 — Manager.preSend has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactionEngine.compactCondensed (cyclomatic 38) · ×1
  • CompactionEngine.compactCondensed (cyclomatic 38) pkg/seahorse/short_compaction.go:307 — CompactionEngine.compactCondensed has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.IsPrivateOrRestrictedIP (cyclomatic 38) · ×1
  • utils.IsPrivateOrRestrictedIP (cyclomatic 38) pkg/utils/http_guard.go:252 — utils.IsPrivateOrRestrictedIP has cyclomatic complexity 38 (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 · openai_compat.parseStreamResponse (cyclomatic 37) · ×1
  • openai_compat.parseStreamResponse (cyclomatic 37) pkg/providers/openai_compat/provider.go:615 — openai_compat.parseStreamResponse has cyclomatic complexity 37 (threshold 15). Of this number, 18 points are the body's own statements and 19 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 · api.validateConfig (cyclomatic 37) · ×1
  • api.validateConfig (cyclomatic 37) web/backend/api/config.go:325 — api.validateConfig 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 · ExecTool.runBackground (cyclomatic 36) · ×1
  • ExecTool.runBackground (cyclomatic 36) pkg/tools/shell.go:507 — ExecTool.runBackground has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 647, 608, 586). 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 · protocol.handlePicoMessage (cyclomatic 36) · ×1
  • protocol.handlePicoMessage (cyclomatic 36) web/frontend/src/features/chat/protocol.ts:96 — protocol.handlePicoMessage has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OneBotChannel.parseMessageSegments (cyclomatic 35) · ×1
  • OneBotChannel.parseMessageSegments (cyclomatic 35) pkg/channels/onebot/onebot.go:718 — OneBotChannel.parseMessageSegments has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its 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.handleUpdateModel (cyclomatic 35) · ×1
  • Handler.handleUpdateModel (cyclomatic 35) web/backend/api/models.go:742 — Handler.handleUpdateModel has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentLoop.ensureMCPInitialized (cyclomatic 34) · ×1
  • AgentLoop.ensureMCPInitialized (cyclomatic 34) pkg/agent/agent_mcp.go:78 — AgentLoop.ensureMCPInitialized has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). 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 · chat-page.ChatPage (cyclomatic 34) · ×1
  • chat-page.ChatPage (cyclomatic 34) web/frontend/src/components/chat/chat-page.tsx:103 — chat-page.ChatPage has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 13 function items inside it that branch (handleSend, appendImageFiles, handleComposerDragLeave, …). 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 · add-model-sheet.AddModelSheet (cyclomatic 34) · ×1
  • add-model-sheet.AddModelSheet (cyclomatic 34) web/frontend/src/components/models/add-model-sheet.tsx:107 — add-model-sheet.AddModelSheet has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (add-model-sheet.AddModelSheet::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · edit-model-sheet.EditModelSheet (cyclomatic 34) · ×1
  • edit-model-sheet.EditModelSheet (cyclomatic 34) web/frontend/src/components/models/edit-model-sheet.tsx:114 — edit-model-sheet.EditModelSheet has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (edit-model-sheet.EditModelSheet::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · Manager.getChannelConfigAndEnabled (cyclomatic 33) · ×1
  • Manager.getChannelConfigAndEnabled (cyclomatic 33) pkg/channels/manager.go:1025 — Manager.getChannelConfigAndEnabled has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
D1 · Cyclomatic Complexity · WebFetchTool.Execute (cyclomatic 33) · ×1
  • WebFetchTool.Execute (cyclomatic 33) pkg/tools/integration/web.go:2099 — WebFetchTool.Execute has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wecom-form.WecomForm (cyclomatic 32) · ×1
  • wecom-form.WecomForm (cyclomatic 32) web/frontend/src/components/channels/channel-forms/wecom-form.tsx:43 — wecom-form.WecomForm has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 6 function items inside it that branch (renderBindSection, a function literal at line 91, a function literal at line 125, …). 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 · ansi-log.parseAnsiSegments (cyclomatic 32) · ×1
  • ansi-log.parseAnsiSegments (cyclomatic 32) web/frontend/src/lib/ansi-log.ts:143 — ansi-log.parseAnsiSegments has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp.parseAddArgs (cyclomatic 31) · ×1
  • mcp.parseAddArgs (cyclomatic 31) cmd/picoclaw/internal/mcp/add.go:85 — mcp.parseAddArgs 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 · agent.sanitizeHistoryForProvider (cyclomatic 31) · ×1
  • agent.sanitizeHistoryForProvider (cyclomatic 31) pkg/agent/context.go:1023 — agent.sanitizeHistoryForProvider 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 · GeminiProvider.buildRequestBody (cyclomatic 31) · ×1
  • GeminiProvider.buildRequestBody (cyclomatic 31) pkg/providers/httpapi/gemini_provider.go:228 — GeminiProvider.buildRequestBody 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 · Assembler.Assemble (cyclomatic 31) · ×1
  • Assembler.Assemble (cyclomatic 31) pkg/seahorse/short_assembler.go:38 — Assembler.Assemble 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 · TelegramChannel.handleMessages (cyclomatic 30) · ×1
  • TelegramChannel.handleMessages (cyclomatic 30) pkg/channels/telegram/telegram.go:1036 — TelegramChannel.handleMessages has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · anthropicmessages.buildRequestBody (cyclomatic 30) · ×1
  • anthropicmessages.buildRequestBody (cyclomatic 30) pkg/providers/anthropic_messages/provider.go:158 — anthropicmessages.buildRequestBody has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecTool.guardCommand (cyclomatic 30) · ×1
  • ExecTool.guardCommand (cyclomatic 30) pkg/tools/shell.go:1152 — ExecTool.guardCommand has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeltaChatChannel.handleMessage (cyclomatic 29) · ×1
  • DeltaChatChannel.handleMessage (cyclomatic 29) pkg/channels/deltachat/handler.go:60 — DeltaChatChannel.handleMessage has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · gateway.Run (cyclomatic 29) · ×1
  • gateway.Run (cyclomatic 29) pkg/gateway/gateway.go:120 — gateway.Run has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · anthropicprovider.buildParams (cyclomatic 29) · ×1
  • anthropicprovider.buildParams (cyclomatic 29) pkg/providers/anthropic/provider.go:141 — anthropicprovider.buildParams 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 · bedrock.parseStreamResponse (cyclomatic 29) · ×1
  • bedrock.parseStreamResponse (cyclomatic 29) pkg/providers/bedrock/provider_bedrock.go:298 — bedrock.parseStreamResponse has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompactionEngine.compactLeaf (cyclomatic 29) · ×1
  • CompactionEngine.compactLeaf (cyclomatic 29) pkg/seahorse/short_compaction.go:171 — CompactionEngine.compactLeaf 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 · Handler.startGatewayLocked (cyclomatic 29) · ×1
  • Handler.startGatewayLocked (cyclomatic 29) web/backend/api/gateway.go:1025 — Handler.startGatewayLocked has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1133, 1113). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · config-page.ConfigPage · ×1
  • config-page.ConfigPage::handleSave (cyclomatic 29) web/frontend/src/components/config/config-page.tsx:295 — config-page.ConfigPage::handleSave 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. This shape REPEATS in the file: one other method here (config-page.ConfigPage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · agent.appendEventContextFields (cyclomatic 28) · ×1
  • agent.appendEventContextFields (cyclomatic 28) pkg/agent/agent_utils.go:245 — agent.appendEventContextFields 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 · LINEChannel.processEvent (cyclomatic 28) · ×1
  • LINEChannel.processEvent (cyclomatic 28) pkg/channels/line/line.go:179 — LINEChannel.processEvent has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TelegramChannel.Send (cyclomatic 28) · ×1
  • TelegramChannel.Send (cyclomatic 28) pkg/channels/telegram/telegram.go:218 — TelegramChannel.Send 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 · evolution.buildFallbackPatternsWithEvidence (cyclomatic 28) · ×1
  • evolution.buildFallbackPatternsWithEvidence (cyclomatic 28) REDACTED:301 — evolution.buildFallbackPatternsWithEvidence has cyclomatic complexity 28 (threshold 15). Of this number, 25 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 · providers.ResolveModelConfig (cyclomatic 28) · ×1
  • providers.ResolveModelConfig (cyclomatic 28) pkg/providers/legacy_provider.go:18 — providers.ResolveModelConfig 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 · api.applySecureStringsToStruct (cyclomatic 28) · ×1
  • api.applySecureStringsToStruct (cyclomatic 28) web/backend/api/config.go:740 — api.applySecureStringsToStruct 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 · api.computeConfigSignature (cyclomatic 28) · ×1
  • api.computeConfigSignature (cyclomatic 28) web/backend/api/gateway.go:421 — api.computeConfigSignature has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentLoop.Run (cyclomatic 27) · ×1
  • AgentLoop.Run (cyclomatic 27) pkg/agent/agent.go:145 — AgentLoop.Run has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 218). 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 · agent.normalizeProcessOptions (cyclomatic 27) · ×1
  • agent.normalizeProcessOptions (cyclomatic 27) pkg/agent/dispatch_request.go:65 — agent.normalizeProcessOptions has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.collectSensitive (cyclomatic 27) · ×1
  • config.collectSensitive (cyclomatic 27) pkg/config/security.go:254 — config.collectSensitive has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstallSkillTool.Execute (cyclomatic 27) · ×1
  • InstallSkillTool.Execute (cyclomatic 27) pkg/tools/integration/skills_install.go:76 — InstallSkillTool.Execute has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecTool.executeRun (cyclomatic 27) · ×1
  • ExecTool.executeRun (cyclomatic 27) pkg/tools/shell.go:295 — ExecTool.executeRun has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SpawnStatusTool.Execute (cyclomatic 27) · ×1
  • SpawnStatusTool.Execute (cyclomatic 27) pkg/tools/spawn_status.go:51 — SpawnStatusTool.Execute has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.applyToolState (cyclomatic 27) · ×1
  • api.applyToolState (cyclomatic 27) web/backend/api/tools.go:337 — api.applyToolState has cyclomatic complexity 27 (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 · edit-model-sheet.EditModelSheet · ×1
  • edit-model-sheet.EditModelSheet::handleSave (cyclomatic 27) web/frontend/src/components/models/edit-model-sheet.tsx:327 — edit-model-sheet.EditModelSheet::handleSave has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (edit-model-sheet.EditModelSheet) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · LLMClient.Complete (cyclomatic 26) · ×1
  • LLMClient.Complete (cyclomatic 26) cmd/membench/llm_client.go:81 — LLMClient.Complete 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 · DiscordChannel.handleMessage (cyclomatic 26) · ×1
  • DiscordChannel.handleMessage (cyclomatic 26) pkg/channels/discord/discord.go:524 — DiscordChannel.handleMessage has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TelegramChannel.SendMedia (cyclomatic 26) · ×1
  • TelegramChannel.SendMedia (cyclomatic 26) pkg/channels/telegram/telegram.go:627 — TelegramChannel.SendMedia 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 · weixin-form.WeixinForm (cyclomatic 26) · ×1
  • weixin-form.WeixinForm (cyclomatic 26) web/frontend/src/components/channels/channel-forms/weixin-form.tsx:57 — weixin-form.WeixinForm has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (renderBindSection, a function literal at line 100, handleBind, …). 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 · tool-calls.parseToolCallsValue (cyclomatic 26) · ×1
  • tool-calls.parseToolCallsValue (cyclomatic 26) web/frontend/src/features/chat/tool-calls.ts:39 — tool-calls.parseToolCallsValue 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 · agent.inferSkillNamesFromToolCall (cyclomatic 25) · ×1
  • agent.inferSkillNamesFromToolCall (cyclomatic 25) pkg/agent/pipeline_execute.go:34 — agent.inferSkillNamesFromToolCall 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 · audio.SplitSentences (cyclomatic 25) · ×1
  • audio.SplitSentences (cyclomatic 25) pkg/audio/sentence.go:12 — audio.SplitSentences has cyclomatic complexity 25 (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 · channels.SplitMessage (cyclomatic 25) · ×1
  • channels.SplitMessage (cyclomatic 25) pkg/channels/split.go:13 — channels.SplitMessage 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 · WeixinChannel.pollLoop (cyclomatic 25) · ×1
  • WeixinChannel.pollLoop (cyclomatic 25) pkg/channels/weixin/weixin.go:155 — WeixinChannel.pollLoop 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 · config.loadConfigMap (cyclomatic 25) · ×1
  • config.loadConfigMap (cyclomatic 25) pkg/config/migration.go:404 — config.loadConfigMap 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 · netbind.BuildPlan (cyclomatic 25) · ×1
  • netbind.BuildPlan (cyclomatic 25) pkg/netbind/netbind.go:184 — netbind.BuildPlan 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 · httpapi.parseGeminiStreamResponse (cyclomatic 25) · ×1
  • httpapi.parseGeminiStreamResponse (cyclomatic 25) pkg/providers/httpapi/gemini_provider.go:518 — httpapi.parseGeminiStreamResponse 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 · form-model.buildFormFromConfig (cyclomatic 25) · ×1
  • form-model.buildFormFromConfig (cyclomatic 25) web/frontend/src/components/config/form-model.ts:291 — form-model.buildFormFromConfig has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · status.statusCmd (cyclomatic 24) · ×1
  • status.statusCmd (cyclomatic 24) cmd/picoclaw/internal/status/helpers.go:14 — status.statusCmd has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 46, 59, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AgentLoop.publishPicoToolCallInterim (cyclomatic 24) · ×1
  • AgentLoop.publishPicoToolCallInterim (cyclomatic 24) pkg/agent/agent_outbound.go:148 — AgentLoop.publishPicoToolCallInterim 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 · agent.spawnSubTurn (cyclomatic 24) · ×1
  • agent.spawnSubTurn (cyclomatic 24) pkg/agent/subturn.go:269 — agent.spawnSubTurn has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MatrixChannel.handleMessageEvent (cyclomatic 24) · ×1
  • MatrixChannel.handleMessageEvent (cyclomatic 24) pkg/channels/matrix/matrix.go:772 — MatrixChannel.handleMessageEvent has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OneBotChannel.handleMessage (cyclomatic 24) · ×1
  • OneBotChannel.handleMessage (cyclomatic 24) pkg/channels/onebot/onebot.go:931 — OneBotChannel.handleMessage has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · wecom.detectWeComMediaMetadata (cyclomatic 24) · ×1
  • wecom.detectWeComMediaMetadata (cyclomatic 24) REDACTED:219 — wecom.detectWeComMediaMetadata has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WeComChannel.resolveOutboundPart (cyclomatic 24) · ×1
  • WeComChannel.resolveOutboundPart (cyclomatic 24) REDACTED:459 — WeComChannel.resolveOutboundPart has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.applySkillsRegistryEnvCompat (cyclomatic 24) · ×1
  • config.applySkillsRegistryEnvCompat (cyclomatic 24) REDACTED:1554 — config.applySkillsRegistryEnvCompat has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: ToolsConfig.IsToolEnabled (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · config.applyLegacySkillsSecurityNode (cyclomatic 24) · ×1
  • config.applyLegacySkillsSecurityNode (cyclomatic 24) pkg/config/security.go:126 — config.applyLegacySkillsSecurityNode has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AntigravityProvider.buildRequest (cyclomatic 24) · ×1
  • AntigravityProvider.buildRequest (cyclomatic 24) REDACTED:207 — AntigravityProvider.buildRequest has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexProvider.Chat (cyclomatic 24) · ×1
  • CodexProvider.Chat (cyclomatic 24) pkg/providers/oauth/codex_provider.go:58 — CodexProvider.Chat has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GitHubRegistry.Search (cyclomatic 24) · ×1
  • GitHubRegistry.Search (cyclomatic 24) pkg/skills/github_registry.go:128 — GitHubRegistry.Search 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, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReadFileTool.Execute (cyclomatic 24) · ×1
  • ReadFileTool.Execute (cyclomatic 24) pkg/tools/fs/filesystem.go:395 — ReadFileTool.Execute has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · api.canonicalizeSignatureValue (cyclomatic 24) · ×1
  • api.canonicalizeSignatureValue (cyclomatic 24) web/backend/api/gateway.go:745 — api.canonicalizeSignatureValue has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · modelProbeCacheState.gc (cyclomatic 24) · ×1
  • modelProbeCacheState.gc (cyclomatic 24) web/backend/api/model_status.go:353 — modelProbeCacheState.gc has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fetch-models-dialog.FetchModelsDialog (cyclomatic 24) · ×1
  • fetch-models-dialog.FetchModelsDialog (cyclomatic 24) web/frontend/src/components/models/fetch-models-dialog.tsx:37 — fetch-models-dialog.FetchModelsDialog has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 6 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 · main.runEval (cyclomatic 23) · ×1
  • main.runEval (cyclomatic 23) cmd/membench/main.go:168 — main.runEval 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 · Pipeline.SetupTurn (cyclomatic 23) · ×1
  • Pipeline.SetupTurn (cyclomatic 23) pkg/agent/pipeline_setup.go:16 — Pipeline.SetupTurn has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeixinChannel.handleInboundMessage (cyclomatic 23) · ×1
  • WeixinChannel.handleInboundMessage (cyclomatic 23) pkg/channels/weixin/weixin.go:286 — WeixinChannel.handleInboundMessage 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 · api.applyConfigSecretsFromMap (cyclomatic 23) · ×1
  • api.applyConfigSecretsFromMap (cyclomatic 23) web/backend/api/config.go:654 — api.applyConfigSecretsFromMap 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 · Handler.handleUpdateWebSearchConfig (cyclomatic 23) · ×1
  • Handler.handleUpdateWebSearchConfig (cyclomatic 23) web/backend/api/tools.go:419 — Handler.handleUpdateWebSearchConfig 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 · config-page.ConfigPage (cyclomatic 23) · ×1
  • config-page.ConfigPage (cyclomatic 23) web/frontend/src/components/config/config-page.tsx:102 — config-page.ConfigPage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (config-page.ConfigPage::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · add-model-sheet.AddModelSheet · ×1
  • add-model-sheet.AddModelSheet::handleSave (cyclomatic 23) web/frontend/src/components/models/add-model-sheet.tsx:353 — add-model-sheet.AddModelSheet::handleSave has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (add-model-sheet.AddModelSheet) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · Pipeline.applyBeforeLLMModelRewrite (cyclomatic 22) · ×1
  • Pipeline.applyBeforeLLMModelRewrite (cyclomatic 22) pkg/agent/pipeline_llm.go:730 — Pipeline.applyBeforeLLMModelRewrite 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 · BaseChannel.HandleMessageWithContext (cyclomatic 22) · ×1
  • BaseChannel.HandleMessageWithContext (cyclomatic 22) pkg/channels/base.go:263 — BaseChannel.HandleMessageWithContext 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 · DeltaChatChannel.ensureAccount (cyclomatic 22) · ×1
  • DeltaChatChannel.ensureAccount (cyclomatic 22) pkg/channels/deltachat/deltachat.go:955 — DeltaChatChannel.ensureAccount 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 · DiscordChannel.receiveVoice (cyclomatic 22) · ×1
  • DiscordChannel.receiveVoice (cyclomatic 22) pkg/channels/discord/voice.go:141 — DiscordChannel.receiveVoice has cyclomatic complexity 22 (threshold 15). Of this number, 14 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 · qq.qqWAVDuration (cyclomatic 22) · ×1
  • qq.qqWAVDuration (cyclomatic 22) pkg/channels/qq/audio_duration.go:58 — qq.qqWAVDuration 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 · slackwebhook.renderTable (cyclomatic 22) · ×1
  • slackwebhook.renderTable (cyclomatic 22) pkg/channels/slack_webhook/convert.go:140 — slackwebhook.renderTable 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.handleSearchSkills (cyclomatic 22) · ×1
  • Handler.handleSearchSkills (cyclomatic 22) web/backend/api/skills.go:172 — Handler.handleSearchSkills 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 · FeishuChannel.handleMessageReceive (cyclomatic 21) · ×1
  • FeishuChannel.handleMessageReceive (cyclomatic 21) REDACTED:583 — FeishuChannel.handleMessageReceive 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 · Manager.StartAll (cyclomatic 21) · ×1
  • Manager.StartAll (cyclomatic 21) pkg/channels/manager.go:1214 — Manager.StartAll has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeComChannel.dispatchIncoming (cyclomatic 21) · ×1
  • WeComChannel.dispatchIncoming (cyclomatic 21) pkg/channels/wecom/wecom.go:481 — WeComChannel.dispatchIncoming 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 · geminiSchemaSanitizer.mergeUnionBranches (cyclomatic 21) · ×1
  • geminiSchemaSanitizer.mergeUnionBranches (cyclomatic 21) pkg/providers/common/google_schema.go:168 — geminiSchemaSanitizer.mergeUnionBranches 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 · RetrievalEngine.Grep (cyclomatic 21) · ×1
  • RetrievalEngine.Grep (cyclomatic 21) pkg/seahorse/short_retrieval.go:95 — RetrievalEngine.Grep 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 · tools.checkType (cyclomatic 21) · ×1
  • tools.checkType (cyclomatic 21) pkg/tools/validate.go:98 — tools.checkType 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 · TavilySearchProvider.Search (cyclomatic 21) · ×1
  • TavilySearchProvider.Search (cyclomatic 21) pkg/tools/integration/web.go:394 — TavilySearchProvider.Search 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 · Handler.handleInstallSkill (cyclomatic 21) · ×1
  • Handler.handleInstallSkill (cyclomatic 21) web/backend/api/skills.go:285 — Handler.handleInstallSkill 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 · main.launcherConsoleHostsWithLocalAddrs (cyclomatic 21) · ×1
  • main.launcherConsoleHostsWithLocalAddrs (cyclomatic 21) REDACTED:249 — main.launcherConsoleHostsWithLocalAddrs 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 · market-skill-card.MarketSkillCard (cyclomatic 21) · ×1
  • market-skill-card.MarketSkillCard (cyclomatic 21) web/frontend/src/components/agent/hub/market-skill-card.tsx:27 — market-skill-card.MarketSkillCard has cyclomatic complexity 21 (threshold 15). Of this number, 18 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 · message-code-block.MessageCodeBlock (cyclomatic 21) · ×1
  • message-code-block.MessageCodeBlock (cyclomatic 21) web/frontend/src/components/chat/message-code-block.tsx:65 — message-code-block.MessageCodeBlock has cyclomatic complexity 21 (threshold 15). Of this number, 18 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 · models-page.modelReferenceAllowedAfterModelChange (cyclomatic 21) · ×1
  • models-page.modelReferenceAllowedAfterModelChange (cyclomatic 21) web/frontend/src/components/models/models-page.tsx:85 — models-page.modelReferenceAllowedAfterModelChange has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AgentLoop.ReloadProviderAndConfig (cyclomatic 20) · ×1
  • AgentLoop.ReloadProviderAndConfig (cyclomatic 20) pkg/agent/agent.go:376 — AgentLoop.ReloadProviderAndConfig has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent.resolveMediaRefs (cyclomatic 20) · ×1
  • agent.resolveMediaRefs (cyclomatic 20) pkg/agent/agent_media.go:60 — agent.resolveMediaRefs 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 · agent.transientLLMRetryReason (cyclomatic 20) · ×1
  • agent.transientLLMRetryReason (cyclomatic 20) pkg/agent/pipeline_llm.go:821 — agent.transientLLMRetryReason has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Pipeline.tryConfiguredStreamingLLM (cyclomatic 20) · ×1
  • Pipeline.tryConfiguredStreamingLLM (cyclomatic 20) pkg/agent/pipeline_streaming.go:17 — Pipeline.tryConfiguredStreamingLLM has cyclomatic complexity 20 (threshold 15). Of this number, 16 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 · tts.SynthesizeAndStore (cyclomatic 20) · ×1
  • tts.SynthesizeAndStore (cyclomatic 20) pkg/audio/tts/tts.go:89 — tts.SynthesizeAndStore has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiscordChannel.SendMedia (cyclomatic 20) · ×1
  • DiscordChannel.SendMedia (cyclomatic 20) pkg/channels/discord/discord.go:261 — DiscordChannel.SendMedia has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MatrixChannel.SendMedia (cyclomatic 20) · ×1
  • MatrixChannel.SendMedia (cyclomatic 20) pkg/channels/matrix/matrix.go:456 — MatrixChannel.SendMedia 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 · weixin.PerformLoginInteractive (cyclomatic 20) · ×1
  • weixin.PerformLoginInteractive (cyclomatic 20) pkg/channels/weixin/auth.go:25 — weixin.PerformLoginInteractive 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 · WeixinChannel.resolveOutboundPart (cyclomatic 20) · ×1
  • WeixinChannel.resolveOutboundPart (cyclomatic 20) REDACTED:694 — WeixinChannel.resolveOutboundPart 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 · config.migrateV1ToV2 (cyclomatic 20) · ×1
  • config.migrateV1ToV2 (cyclomatic 20) pkg/config/migration.go:270 — config.migrateV1ToV2 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 · common.mergeGeminiSchemaMaps (cyclomatic 20) · ×1
  • common.mergeGeminiSchemaMaps (cyclomatic 20) pkg/providers/common/google_schema.go:331 — common.mergeGeminiSchemaMaps 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 · GrepTool.Execute (cyclomatic 20) · ×1
  • GrepTool.Execute (cyclomatic 20) pkg/seahorse/tool_grep.go:114 — GrepTool.Execute has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CronTool.addJob (cyclomatic 20) · ×1
  • CronTool.addJob (cyclomatic 20) pkg/tools/cron.go:167 — CronTool.addJob has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tools.encodeKeyToken (cyclomatic 20) · ×1
  • tools.encodeKeyToken (cyclomatic 20) pkg/tools/shell.go:960 — tools.encodeKeyToken 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 · BraveSearchProvider.Search (cyclomatic 20) · ×1
  • BraveSearchProvider.Search (cyclomatic 20) pkg/tools/integration/web.go:278 — BraveSearchProvider.Search 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 · SogouSearchProvider.Search (cyclomatic 20) · ×1
  • SogouSearchProvider.Search (cyclomatic 20) pkg/tools/integration/web.go:879 — SogouSearchProvider.Search 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 · ExecTool.runSync (cyclomatic 20) · ×1
  • ExecTool.runSync (cyclomatic 20) pkg/tools/shell.go:386 — ExecTool.runSync has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.sessionTranscriptMessages (cyclomatic 20) · ×1
  • api.sessionTranscriptMessages (cyclomatic 20) web/backend/api/session.go:497 — api.sessionTranscriptMessages 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 · ContextBuilder.BuildMessagesFromPrompt (cyclomatic 19) · ×1
  • ContextBuilder.BuildMessagesFromPrompt (cyclomatic 19) pkg/agent/context.go:842 — ContextBuilder.BuildMessagesFromPrompt 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 · tts.NewMimoTTSProvider (cyclomatic 19) · ×1
  • tts.NewMimoTTSProvider (cyclomatic 19) pkg/audio/tts/mimo_tts.go:27 — tts.NewMimoTTSProvider 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 · FeishuChannel.Send (cyclomatic 19) · ×1
  • FeishuChannel.Send (cyclomatic 19) REDACTED:155 — FeishuChannel.Send 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 · SlackChannel.handleMessageEvent (cyclomatic 19) · ×1
  • SlackChannel.handleMessageEvent (cyclomatic 19) pkg/channels/slack/slack.go:313 — SlackChannel.handleMessageEvent has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · weixin.isDownloadableMediaItem (cyclomatic 19) · ×1
  • weixin.isDownloadableMediaItem (cyclomatic 19) REDACTED:394 — weixin.isDownloadableMediaItem 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 · WeixinChannel.downloadMediaFromItem (cyclomatic 19) · ×1
  • WeixinChannel.downloadMediaFromItem (cyclomatic 19) REDACTED:516 — WeixinChannel.downloadMediaFromItem 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 · identity.MatchAllowed (cyclomatic 19) · ×1
  • identity.MatchAllowed (cyclomatic 19) pkg/identity/identity.go:41 — identity.MatchAllowed 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 · KagiSearchProvider.Search (cyclomatic 19) · ×1
  • KagiSearchProvider.Search (cyclomatic 19) pkg/tools/integration/web.go:511 — KagiSearchProvider.Search 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 · WebSearchToolOptions.providerReady (cyclomatic 19) · ×1
  • WebSearchToolOptions.providerReady (cyclomatic 19) pkg/tools/integration/web.go:1581 — WebSearchToolOptions.providerReady has cyclomatic complexity 19 (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 · api.normalizeChannelArrayFields (cyclomatic 19) · ×1
  • api.normalizeChannelArrayFields (cyclomatic 19) web/backend/api/config.go:470 — api.normalizeChannelArrayFields 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.handleTestInlineModel (cyclomatic 19) · ×1
  • Handler.handleTestInlineModel (cyclomatic 19) web/backend/api/models.go:1493 — Handler.handleTestInlineModel 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 · detail-sheet.DetailSheet (cyclomatic 19) · ×1
  • detail-sheet.DetailSheet (cyclomatic 19) web/frontend/src/components/agent/skills/detail-sheet.tsx:51 — detail-sheet.DetailSheet 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 · agent.resolvedCandidateModelConfig (cyclomatic 18) · ×1
  • agent.resolvedCandidateModelConfig (cyclomatic 18) pkg/agent/instance.go:459 — agent.resolvedCandidateModelConfig 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 · tts.NewOpenAITTSProviderWithOptions (cyclomatic 18) · ×1
  • tts.NewOpenAITTSProviderWithOptions (cyclomatic 18) pkg/audio/tts/openai_tts.go:56 — tts.NewOpenAITTSProviderWithOptions 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 · LINEChannel.stripBotMention (cyclomatic 18) · ×1
  • LINEChannel.stripBotMention (cyclomatic 18) pkg/channels/line/line.go:386 — LINEChannel.stripBotMention 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 · qq.qqOggDuration (cyclomatic 18) · ×1
  • qq.qqOggDuration (cyclomatic 18) pkg/channels/qq/audio_duration.go:140 — qq.qqOggDuration 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 · config.migrateV0ToV1 (cyclomatic 18) · ×1
  • config.migrateV0ToV1 (cyclomatic 18) pkg/config/migration.go:178 — config.migrateV0ToV1 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 · SkillRegistryConfig.UnmarshalJSON (cyclomatic 18) · ×1
  • SkillRegistryConfig.UnmarshalJSON (cyclomatic 18) pkg/config/config_struct.go:445 — SkillRegistryConfig.UnmarshalJSON 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 · cliprovider.NormalizeToolCall (cyclomatic 18) · ×1
  • cliprovider.NormalizeToolCall (cyclomatic 18) pkg/providers/cli/toolcall_utils.go:55 — cliprovider.NormalizeToolCall 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 · skills.parseGitHubTargetWithBaseURL (cyclomatic 18) · ×1
  • skills.parseGitHubTargetWithBaseURL (cyclomatic 18) pkg/skills/installer.go:251 — skills.parseGitHubTargetWithBaseURL 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 · tools.RunToolLoop (cyclomatic 18) · ×1
  • tools.RunToolLoop (cyclomatic 18) pkg/tools/toolloop.go:43 — tools.RunToolLoop has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fstools.isBinaryReadFileData (cyclomatic 18) · ×1
  • fstools.isBinaryReadFileData (cyclomatic 18) pkg/tools/fs/filesystem.go:714 — fstools.isBinaryReadFileData has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · api.normalizeStoredModelConfig (cyclomatic 18) · ×1
  • api.normalizeStoredModelConfig (cyclomatic 18) web/backend/api/models.go:78 — api.normalizeStoredModelConfig 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 · Handler.findPicoJSONLSessions (cyclomatic 18) · ×1
  • Handler.findPicoJSONLSessions (cyclomatic 18) web/backend/api/session.go:273 — Handler.findPicoJSONLSessions 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 · Handler.handleListSessions (cyclomatic 18) · ×1
  • Handler.handleListSessions (cyclomatic 18) web/backend/api/session.go:820 — Handler.handleListSessions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth.LoginBrowserWithOptions (cyclomatic 17) · ×1
  • auth.LoginBrowserWithOptions (cyclomatic 17) REDACTED:91 — auth.LoginBrowserWithOptions has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseChannel.IsAllowed (cyclomatic 17) · ×1
  • BaseChannel.IsAllowed (cyclomatic 17) pkg/channels/base.go:204 — BaseChannel.IsAllowed 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 · DingTalkChannel.onChatBotMessageReceived (cyclomatic 17) · ×1
  • DingTalkChannel.onChatBotMessageReceived (cyclomatic 17) pkg/channels/dingtalk/dingtalk.go:139 — DingTalkChannel.onChatBotMessageReceived 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 · OneBotChannel.SendMedia (cyclomatic 17) · ×1
  • OneBotChannel.SendMedia (cyclomatic 17) pkg/channels/onebot/onebot.go:454 — OneBotChannel.SendMedia 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 · PicoChannel.SendMedia (cyclomatic 17) · ×1
  • PicoChannel.SendMedia (cyclomatic 17) REDACTED:748 — PicoChannel.SendMedia 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 · SkillsRegistriesConfig.UnmarshalJSON (cyclomatic 17) · ×1
  • SkillsRegistriesConfig.UnmarshalJSON (cyclomatic 17) pkg/config/config_struct.go:360 — SkillsRegistriesConfig.UnmarshalJSON 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 · SkillRegistryConfig.UnmarshalYAML (cyclomatic 17) · ×1
  • SkillRegistryConfig.UnmarshalYAML (cyclomatic 17) pkg/config/config_struct.go:523 — SkillRegistryConfig.UnmarshalYAML 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 · LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cyclomatic 17) · ×1
  • LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cyclomatic 17) REDACTED:460 — LLMPatternClusterer.validateAndBuildPatternsWithEvidence 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 · JSONLStore.ResolveSessionKey (cyclomatic 17) · ×1
  • JSONLStore.ResolveSessionKey (cyclomatic 17) pkg/memory/jsonl.go:295 — JSONLStore.ResolveSessionKey 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 · netbind.probeHostForGroups (cyclomatic 17) · ×1
  • netbind.probeHostForGroups (cyclomatic 17) pkg/netbind/netbind.go:378 — netbind.probeHostForGroups has cyclomatic complexity 17 (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 · Provider.Chat (cyclomatic 17) · ×1
  • Provider.Chat (cyclomatic 17) pkg/providers/azure/provider.go:122 — Provider.Chat 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 · Provider.buildRequestBody (cyclomatic 17) · ×1
  • Provider.buildRequestBody (cyclomatic 17) pkg/providers/openai_compat/provider.go:146 — Provider.buildRequestBody 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 · MCPTool.normalizeResultContent (cyclomatic 17) · ×1
  • MCPTool.normalizeResultContent (cyclomatic 17) pkg/tools/integration/mcp_tool.go:361 — MCPTool.normalizeResultContent 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 · PerplexitySearchProvider.Search (cyclomatic 17) · ×1
  • PerplexitySearchProvider.Search (cyclomatic 17) pkg/tools/integration/web.go:1081 — PerplexitySearchProvider.Search 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 · utils.DownloadFile (cyclomatic 17) · ×1
  • utils.DownloadFile (cyclomatic 17) pkg/utils/media.go:76 — utils.DownloadFile 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 · WhatsAppNativeChannel.Start (cyclomatic 17) · ×1
  • WhatsAppNativeChannel.Start (cyclomatic 17) pkg/channels/whatsapp_native/whatsapp_native.go:85 — WhatsAppNativeChannel.Start has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its 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-composer.ChatComposer (cyclomatic 17) · ×1
  • chat-composer.ChatComposer (cyclomatic 17) web/frontend/src/components/chat/chat-composer.tsx:47 — chat-composer.ChatComposer has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 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 · model-selector.ModelSelector (cyclomatic 17) · ×1
  • model-selector.ModelSelector (cyclomatic 17) web/frontend/src/components/chat/model-selector.tsx:24 — model-selector.ModelSelector 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 · tour-guide.TourGuide (cyclomatic 17) · ×1
  • tour-guide.TourGuide (cyclomatic 17) web/frontend/src/components/tour/tour-guide.tsx:28 — tour-guide.TourGuide has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · controller.connectChat (cyclomatic 17) · ×1
  • controller.connectChat (cyclomatic 17) web/frontend/src/features/chat/controller.ts:109 — controller.connectChat has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · __root.RootLayout (cyclomatic 17) · ×1
  • __root.RootLayout (cyclomatic 17) web/frontend/src/routes/__root.tsx:10 — __root.RootLayout has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · mcp.buildServerConfig (cyclomatic 16) · ×1
  • mcp.buildServerConfig (cyclomatic 16) cmd/picoclaw/internal/mcp/add.go:175 — mcp.buildServerConfig 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 · DiscordChannel.playTTS (cyclomatic 16) · ×1
  • DiscordChannel.playTTS (cyclomatic 16) pkg/channels/discord/discord.go:883 — DiscordChannel.playTTS has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PicoChannel.Send (cyclomatic 16) · ×1
  • PicoChannel.Send (cyclomatic 16) REDACTED:298 — PicoChannel.Send 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 · WeComChannel.storeRemoteMedia (cyclomatic 16) · ×1
  • WeComChannel.storeRemoteMedia (cyclomatic 16) REDACTED:275 — WeComChannel.storeRemoteMedia 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 · WeComChannel.SendMedia (cyclomatic 16) · ×1
  • WeComChannel.SendMedia (cyclomatic 16) pkg/channels/wecom/wecom.go:222 — WeComChannel.SendMedia has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeComChannel.collectMixedMedia (cyclomatic 16) · ×1
  • WeComChannel.collectMixedMedia (cyclomatic 16) pkg/channels/wecom/wecom.go:632 — WeComChannel.collectMixedMedia has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.loadSecurityConfig (cyclomatic 16) · ×1
  • config.loadSecurityConfig (cyclomatic 16) pkg/config/security.go:34 — config.loadSecurityConfig 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 · RawNode.UnmarshalJSON (cyclomatic 16) · ×1
  • RawNode.UnmarshalJSON (cyclomatic 16) pkg/config/config_channel.go:73 — RawNode.UnmarshalJSON 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 · USBMonitor.Start (cyclomatic 16) · ×1
  • USBMonitor.Start (cyclomatic 16) pkg/devices/sources/usb_linux.go:50 — USBMonitor.Start has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). 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 · Store.MarkTaskRecordsClustered (cyclomatic 16) · ×1
  • Store.MarkTaskRecordsClustered (cyclomatic 16) REDACTED:194 — Store.MarkTaskRecordsClustered 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 · mcp.connectServer (cyclomatic 16) · ×1
  • mcp.connectServer (cyclomatic 16) pkg/mcp/manager.go:324 — mcp.connectServer 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 · Provider.Chat (cyclomatic 16) · ×1
  • Provider.Chat (cyclomatic 16) pkg/providers/anthropic_messages/provider.go:72 — Provider.Chat 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 · providers.ClassifyError (cyclomatic 16) · ×1
  • providers.ClassifyError (cyclomatic 16) pkg/providers/error_classifier.go:151 — providers.ClassifyError 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 · CodexCliProvider.parseJSONLEvents (cyclomatic 16) · ×1
  • CodexCliProvider.parseJSONLEvents (cyclomatic 16) pkg/providers/cli/codex_cli_provider.go:166 — CodexCliProvider.parseJSONLEvents 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 · common.serializeToolCalls (cyclomatic 16) · ×1
  • common.serializeToolCalls (cyclomatic 16) pkg/providers/common/common.go:159 — common.serializeToolCalls 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 · geminiSchemaSanitizer.sanitizeNode (cyclomatic 16) · ×1
  • geminiSchemaSanitizer.sanitizeNode (cyclomatic 16) pkg/providers/common/google_schema.go:52 — geminiSchemaSanitizer.sanitizeNode 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 · seahorse.partsMatch (cyclomatic 16) · ×1
  • seahorse.partsMatch (cyclomatic 16) pkg/seahorse/short_engine.go:793 — seahorse.partsMatch 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 · session.buildSessionScope (cyclomatic 16) · ×1
  • session.buildSessionScope (cyclomatic 16) pkg/session/allocator.go:45 — session.buildSessionScope 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 · GeminiSearchProvider.Search (cyclomatic 16) · ×1
  • GeminiSearchProvider.Search (cyclomatic 16) pkg/tools/integration/web.go:779 — GeminiSearchProvider.Search 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 · Handler.handlePatchConfig (cyclomatic 16) · ×1
  • Handler.handlePatchConfig (cyclomatic 16) web/backend/api/config.go:134 — Handler.handlePatchConfig 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.handlePollWecomFlow (cyclomatic 16) · ×1
  • Handler.handlePollWecomFlow (cyclomatic 16) web/backend/api/wecom.go:132 — Handler.handlePollWecomFlow 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 · Handler.handlePollWeixinFlow (cyclomatic 16) · ×1
  • Handler.handlePollWeixinFlow (cyclomatic 16) web/backend/api/weixin.go:112 — Handler.handlePollWeixinFlow 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 · context-usage-ring.ContextUsageRing (cyclomatic 16) · ×1
  • context-usage-ring.ContextUsageRing (cyclomatic 16) web/frontend/src/components/chat/context-usage-ring.tsx:17 — context-usage-ring.ContextUsageRing has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 31, a function literal at line 47, handleDetail, …). 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 · protocol.parseAttachments (cyclomatic 16) · ×1
  • protocol.parseAttachments (cyclomatic 16) web/frontend/src/features/chat/protocol.ts:22 — protocol.parseAttachments 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 · use-credentials-page.useCredentialsPage (cyclomatic 16) · ×1
  • use-credentials-page.useCredentialsPage (cyclomatic 16) web/frontend/src/hooks/use-credentials-page.ts:24 — use-credentials-page.useCredentialsPage 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 6 function literals inside it that branch (lines 75, 144, 67, …). 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×1
  • Repeated repair: pkg/agent/context_usage.go pkg/agent/context_usage.go:17 — pkg/agent/context_usage.go changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is agent.computeContextUsage at line 17), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(context): expose history tokens and remove leaked state files”; “fix(context): address review - clarify threshold alignment, i18n strings, add test coverage”; “fix(context): show both summarize and compress thresholds in /context”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-05-21..2026-08-19, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-21 17:17:32 +08:00' --until='2026-08-19 17:17:32 +08:00' --full-history --no-merges -- pkg/agent/context_usage.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.
D2 · Cognitive Complexity · Pipeline.ExecuteTools (cognitive 307) · ×1
  • Pipeline.ExecuteTools (cognitive 307) pkg/agent/pipeline_execute.go:111 — Pipeline.ExecuteTools has cognitive complexity 307 (threshold 15). Drivers by points: if/else 73 (250 pts), loops 5 (21 pts), boolean chains 19, match/switch 4 (15 pts), jumps 2 (nesting depth added 204). Of this number, 298 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · config.v0ProvidersMapToModelList (cognitive 230) · ×1
  • config.v0ProvidersMapToModelList (cognitive 230) pkg/config/config_old.go:32 — config.v0ProvidersMapToModelList has cognitive complexity 230 (threshold 15). Drivers by points: if/else 108 (123 pts), boolean chains 101, loops 3 (6 pts) (nesting depth added 18). Of this number, 30 points are the body's own statements and 200 belong to 25 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 · Pipeline.CallLLM (cognitive 156) · ×1
  • Pipeline.CallLLM (cognitive 156) pkg/agent/pipeline_llm.go:22 — Pipeline.CallLLM has cognitive complexity 156 (threshold 15). Drivers by points: if/else 65 (122 pts), boolean chains 22, loops 6 (8 pts), match/switch 2 (4 pts) (nesting depth added 61). Of this number, 131 points are the body's own statements and 25 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 · agent.registerSharedTools (cognitive 103) · ×1
  • agent.registerSharedTools (cognitive 103) pkg/agent/agent_init.go:108 — agent.registerSharedTools has cognitive complexity 103 (threshold 15). Drivers by points: if/else 37 (91 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 56). Of this number, 62 points are the body's own statements and 41 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.applySecureStringsToStruct (cognitive 100) · ×1
  • api.applySecureStringsToStruct (cognitive 100) web/backend/api/config.go:740 — api.applySecureStringsToStruct has cognitive complexity 100 (threshold 15). Drivers by points: if/else 20 (84 pts), loops 4 (13 pts), boolean chains 3 (nesting depth added 73). 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 · models-page.ModelsPage (cognitive 93) · ×1
  • models-page.ModelsPage (cognitive 93) web/frontend/src/components/models/models-page.tsx:466 — models-page.ModelsPage has cognitive complexity 93 (threshold 15). Drivers by points: boolean chains 46, if/else 27 (30 pts), ternaries 8 (13 pts), error handling 3, loops 1 (nesting depth added 8). Of this number, 23 points are the body's own statements and 70 belong to 17 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 · ExecTool.runBackground (cognitive 91) · ×1
  • ExecTool.runBackground (cognitive 91) pkg/tools/shell.go:507 — ExecTool.runBackground has cognitive complexity 91 (threshold 15). Drivers by points: if/else 36 (83 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 50). Of this number, 20 points are the body's own statements and 71 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgentLoop.runTurn (cognitive 90) · ×1
  • AgentLoop.runTurn (cognitive 90) pkg/agent/turn_coord.go:17 — AgentLoop.runTurn has cognitive complexity 90 (threshold 15). Drivers by points: if/else 33 (73 pts), match/switch 3 (8 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 47). Of this number, 86 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manager.preSend (cognitive 89) · ×1
  • Manager.preSend (cognitive 89) pkg/channels/manager.go:370 — Manager.preSend has cognitive complexity 89 (threshold 15). Drivers by points: if/else 34 (84 pts), boolean chains 5 (nesting depth added 50). Of this number, 85 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · httpapi.parseGeminiStreamResponse (cognitive 84) · ×1
  • httpapi.parseGeminiStreamResponse (cognitive 84) pkg/providers/httpapi/gemini_provider.go:518 — httpapi.parseGeminiStreamResponse has cognitive complexity 84 (threshold 15). Drivers by points: if/else 20 (76 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 59). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · converter.walk (cognitive 80) · ×1
  • converter.walk (cognitive 80) pkg/utils/markdown.go:138 — converter.walk has cognitive complexity 80 (threshold 15). Drivers by points: if/else 32 (62 pts), loops 6 (12 pts), boolean chains 4, match/switch 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.sanitizeHistoryForProvider (cognitive 79) · ×1
  • agent.sanitizeHistoryForProvider (cognitive 79) pkg/agent/context.go:1023 — agent.sanitizeHistoryForProvider has cognitive complexity 79 (threshold 15). Drivers by points: if/else 18 (60 pts), loops 6 (14 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providers.CreateProviderFromConfig (cognitive 79) · ×1
  • providers.CreateProviderFromConfig (cognitive 79) pkg/providers/factory_provider.go:91 — providers.CreateProviderFromConfig has cognitive complexity 79 (threshold 15). Drivers by points: if/else 36 (72 pts), boolean chains 6, match/switch 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 78) · ×1
  • main.main (cognitive 78) REDACTED:400 — main.main has cognitive complexity 78 (threshold 15). Drivers by points: if/else 47 (61 pts), loops 4 (6 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 19). Of this number, 74 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · CompactionEngine.compactCondensed (cognitive 75) · ×1
  • CompactionEngine.compactCondensed (cognitive 75) pkg/seahorse/short_compaction.go:307 — CompactionEngine.compactCondensed has cognitive complexity 75 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 6 (9 pts), boolean chains 6 (nesting depth added 36). 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 · ExecTool.guardCommand (cognitive 74) · ×1
  • ExecTool.guardCommand (cognitive 74) pkg/tools/shell.go:1152 — ExecTool.guardCommand has cognitive complexity 74 (threshold 15). Drivers by points: if/else 21 (59 pts), loops 4 (11 pts), boolean chains 4 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · anthropicmessages.buildRequestBody (cognitive 73) · ×1
  • anthropicmessages.buildRequestBody (cognitive 73) pkg/providers/anthropic_messages/provider.go:158 — anthropicmessages.buildRequestBody has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (63 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 46). 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 · OneBotChannel.parseMessageSegments (cognitive 72) · ×1
  • OneBotChannel.parseMessageSegments (cognitive 72) pkg/channels/onebot/onebot.go:718 — OneBotChannel.parseMessageSegments has cognitive complexity 72 (threshold 15). Drivers by points: if/else 22 (65 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 44). Of this number, 69 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 · config.loadConfigMap (cognitive 70) · ×1
  • config.loadConfigMap (cognitive 70) pkg/config/migration.go:404 — config.loadConfigMap has cognitive complexity 70 (threshold 15). Drivers by points: if/else 21 (59 pts), loops 2 (10 pts), boolean chains 1 (nesting depth added 46). 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 · channels.SplitMessage (cognitive 69) · ×1
  • channels.SplitMessage (cognitive 69) pkg/channels/split.go:13 — channels.SplitMessage has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (63 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Runtime.RunColdPathOnce (cognitive 69) · ×1
  • Runtime.RunColdPathOnce (cognitive 69) REDACTED:240 — Runtime.RunColdPathOnce has cognitive complexity 69 (threshold 15). Drivers by points: if/else 32 (59 pts), boolean chains 5, loops 3, match/switch 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ansi-log.parseAnsiSegments (cognitive 69) · ×1
  • ansi-log.parseAnsiSegments (cognitive 69) web/frontend/src/lib/ansi-log.ts:143 — ansi-log.parseAnsiSegments has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (56 pts), boolean chains 8, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 38). Of this number, 66 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop.ensureMCPInitialized (cognitive 68) · ×1
  • AgentLoop.ensureMCPInitialized (cognitive 68) pkg/agent/agent_mcp.go:78 — AgentLoop.ensureMCPInitialized has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 6 (11 pts), boolean chains 5 (nesting depth added 34). Most of this is not in the body itself: 9 of the 68 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). 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 · anthropicprovider.buildParams (cognitive 67) · ×1
  • anthropicprovider.buildParams (cognitive 67) pkg/providers/anthropic/provider.go:141 — anthropicprovider.buildParams has cognitive complexity 67 (threshold 15). Drivers by points: if/else 18 (52 pts), loops 3 (9 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop.Run (cognitive 66) · ×1
  • AgentLoop.Run (cognitive 66) pkg/agent/agent.go:145 — AgentLoop.Run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (58 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 43). Of this number, 25 points are the body's own statements and 41 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 · updater.findAssetInfo (cognitive 66) · ×1
  • updater.findAssetInfo (cognitive 66) REDACTED:214 — updater.findAssetInfo has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (50 pts), loops 8 (13 pts), boolean chains 3 (nesting depth added 31). Of this number, 36 points are the body's own statements and 30 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 · WebSearchToolOptions.providerByName (cognitive 63) · ×1
  • WebSearchToolOptions.providerByName (cognitive 63) pkg/tools/integration/web.go:1655 — WebSearchToolOptions.providerByName has cognitive complexity 63 (threshold 15). Drivers by points: if/else 31 (62 pts), match/switch 1 (nesting depth added 31). 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 · AgentLoop.askSideQuestion (cognitive 62) · ×1
  • AgentLoop.askSideQuestion (cognitive 62) pkg/agent/turn_coord.go:365 — AgentLoop.askSideQuestion has cognitive complexity 62 (threshold 15). Drivers by points: if/else 32 (49 pts), boolean chains 9, match/switch 2 (4 pts) (nesting depth added 19). Of this number, 49 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 · config.migrateV1ToV2 (cognitive 62) · ×1
  • config.migrateV1ToV2 (cognitive 62) pkg/config/migration.go:270 — config.migrateV1ToV2 has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (55 pts), loops 3 (7 pts) (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OpenClawConfig.convertChannels (cognitive 62) · ×1
  • OpenClawConfig.convertChannels (cognitive 62) pkg/migrate/sources/openclaw/openclaw_config.go:773 — OpenClawConfig.convertChannels has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33 (51 pts), boolean chains 11 (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 · bedrock.parseStreamResponse (cognitive 62) · ×1
  • bedrock.parseStreamResponse (cognitive 62) pkg/providers/bedrock/provider_bedrock.go:298 — bedrock.parseStreamResponse has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (47 pts), match/switch 4 (13 pts), jumps 1, loops 1 (nesting depth added 42). Of this number, 58 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 · channel-config-page.ChannelConfigPage (cognitive 62) · ×1
  • channel-config-page.ChannelConfigPage (cognitive 62) web/frontend/src/components/channels/channel-config-page.tsx:290 — channel-config-page.ChannelConfigPage has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (25 pts), ternaries 10 (18 pts), boolean chains 10, error handling 5, loops 2 (3 pts), match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 12 of the 62 points are its own statements and the rest belongs to 17 function items inside it that branch (a function literal at line 323, handleSave, a function literal at line 400, …). 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 · AgentLoop.buildCommandsRuntime (cognitive 60) · ×1
  • AgentLoop.buildCommandsRuntime (cognitive 60) pkg/agent/agent_command.go:127 — AgentLoop.buildCommandsRuntime has cognitive complexity 60 (threshold 15). Drivers by points: if/else 33 (47 pts), loops 6 (9 pts), boolean chains 4 (nesting depth added 17). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 302, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · openai_compat.parseStreamResponse (cognitive 60) · ×1
  • openai_compat.parseStreamResponse (cognitive 60) pkg/providers/openai_compat/provider.go:615 — openai_compat.parseStreamResponse has cognitive complexity 60 (threshold 15). Drivers by points: if/else 32 (56 pts), loops 3, boolean chains 1 (nesting depth added 24). Of this number, 31 points are the body's own statements and 29 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 · config.LoadConfig (cognitive 59) · ×1
  • config.LoadConfig (cognitive 59) REDACTED:1293 — config.LoadConfig has cognitive complexity 59 (threshold 15). Drivers by points: if/else 33 (57 pts), boolean chains 1, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Engine.Bootstrap (cognitive 59) · ×1
  • Engine.Bootstrap (cognitive 59) pkg/seahorse/short_engine.go:417 — Engine.Bootstrap has cognitive complexity 59 (threshold 15). Drivers by points: if/else 29 (48 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateConfig (cognitive 58) · ×1
  • api.validateConfig (cognitive 58) web/backend/api/config.go:325 — api.validateConfig has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 13, 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 · GeminiProvider.buildRequestBody (cognitive 57) · ×1
  • GeminiProvider.buildRequestBody (cognitive 57) pkg/providers/httpapi/gemini_provider.go:228 — GeminiProvider.buildRequestBody has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 5 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model-card.ModelCard (cognitive 56) · ×1
  • model-card.ModelCard (cognitive 56) web/frontend/src/components/models/model-card.tsx:32 — model-card.ModelCard has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 31 (42 pts), if/else 8, boolean chains 6 (nesting depth added 11). Of this number, 47 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.
D2 · Cognitive Complexity · config.collectSensitive (cognitive 54) · ×1
  • config.collectSensitive (cognitive 54) pkg/config/security.go:254 — config.collectSensitive has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 6 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · api.sessionTranscriptMessages (cognitive 54) · ×1
  • api.sessionTranscriptMessages (cognitive 54) web/backend/api/session.go:497 — api.sessionTranscriptMessages has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (50 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.startGatewayLocked (cognitive 54) · ×1
  • Handler.startGatewayLocked (cognitive 54) web/backend/api/gateway.go:1025 — Handler.startGatewayLocked has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (50 pts), boolean chains 3, loops 1 (nesting depth added 25). Most of this is not in the body itself: 13 of the 54 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1133, 1113). 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 · channels.hiddenValues (cognitive 53) · ×1
  • channels.hiddenValues (cognitive 53) REDACTED:43 — channels.hiddenValues has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 3 (10 pts), match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.NewAgentInstance (cognitive 52) · ×1
  • agent.NewAgentInstance (cognitive 52) pkg/agent/instance.go:91 — agent.NewAgentInstance has cognitive complexity 52 (threshold 15). Drivers by points: if/else 32 (43 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel.Send (cognitive 52) · ×1
  • TelegramChannel.Send (cognitive 52) pkg/channels/telegram/telegram.go:218 — TelegramChannel.Send has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evolution.buildFallbackPatternsWithEvidence (cognitive 52) · ×1
  • evolution.buildFallbackPatternsWithEvidence (cognitive 52) REDACTED:301 — evolution.buildFallbackPatternsWithEvidence has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 8 (15 pts), boolean chains 4 (nesting depth added 25). Of this number, 48 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 · config.migrateV2ToV3 (cognitive 51) · ×1
  • config.migrateV2ToV3 (cognitive 51) pkg/config/migration.go:347 — config.migrateV2ToV3 has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (43 pts), loops 2 (8 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · agent.appendEventContextFields (cognitive 50) · ×1
  • agent.appendEventContextFields (cognitive 50) pkg/agent/agent_utils.go:245 — agent.appendEventContextFields has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assembler.Assemble (cognitive 50) · ×1
  • Assembler.Assemble (cognitive 50) pkg/seahorse/short_assembler.go:38 — Assembler.Assemble has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (36 pts), loops 8 (11 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · detail-sheet.DetailSheet (cognitive 49) · ×1
  • detail-sheet.DetailSheet (cognitive 49) web/frontend/src/components/agent/skills/detail-sheet.tsx:51 — detail-sheet.DetailSheet has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 15 (46 pts), boolean chains 3 (nesting depth added 31). Of this number, 45 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · app-header.AppHeader (cognitive 49) · ×1
  • app-header.AppHeader (cognitive 49) web/frontend/src/components/app-header.tsx:45 — app-header.AppHeader has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (27 pts), boolean chains 18, if/else 4 (nesting depth added 14). Of this number, 42 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · status.statusCmd (cognitive 48) · ×1
  • status.statusCmd (cognitive 48) cmd/picoclaw/internal/status/helpers.go:14 — status.statusCmd has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 4 (9 pts), boolean chains 5 (nesting depth added 25). Most of this is not in the body itself: 15 of the 48 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 46, 59, 70, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · main.EvalSeahorse (cognitive 47) · ×1
  • main.EvalSeahorse (cognitive 47) cmd/membench/eval.go:98 — main.EvalSeahorse has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (28 pts), loops 6 (18 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel.pollLoop (cognitive 47) · ×1
  • WeixinChannel.pollLoop (cognitive 47) pkg/channels/weixin/weixin.go:155 — WeixinChannel.pollLoop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 5 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadFileLinesTool.Execute (cognitive 47) · ×1
  • ReadFileLinesTool.Execute (cognitive 47) pkg/tools/fs/filesystem.go:536 — ReadFileLinesTool.Execute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 8, loops 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config-page.ConfigPage · ×1
  • config-page.ConfigPage::handleSave (cognitive 47) web/frontend/src/components/config/config-page.tsx:295 — config-page.ConfigPage::handleSave has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 3 (6 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (config-page.ConfigPage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · protocol.handlePicoMessage (cognitive 47) · ×1
  • protocol.handlePicoMessage (cognitive 47) web/frontend/src/features/chat/protocol.ts:96 — protocol.handlePicoMessage has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 6 (11 pts), boolean chains 7, match/switch 1 (nesting depth added 19). Of this number, 21 points are the body's own statements and 26 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.migrateV0ToV1 (cognitive 46) · ×1
  • config.migrateV0ToV1 (cognitive 46) pkg/config/migration.go:178 — config.migrateV0ToV1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (41 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tts.NewMimoTTSProvider (cognitive 44) · ×1
  • tts.NewMimoTTSProvider (cognitive 44) pkg/audio/tts/mimo_tts.go:27 — tts.NewMimoTTSProvider has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 2 (nesting depth added 24). 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 · WebFetchTool.Execute (cognitive 44) · ×1
  • WebFetchTool.Execute (cognitive 44) pkg/tools/integration/web.go:2099 — WebFetchTool.Execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (36 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 12). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel.receiveVoice (cognitive 43) · ×1
  • DiscordChannel.receiveVoice (cognitive 43) pkg/channels/discord/voice.go:141 — DiscordChannel.receiveVoice has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 24). Of this number, 35 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 · tts.NewOpenAITTSProviderWithOptions (cognitive 42) · ×1
  • tts.NewOpenAITTSProviderWithOptions (cognitive 42) pkg/audio/tts/openai_tts.go:56 — tts.NewOpenAITTSProviderWithOptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (40 pts), boolean chains 2 (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 · slackwebhook.renderTable (cognitive 42) · ×1
  • slackwebhook.renderTable (cognitive 42) pkg/channels/slack_webhook/convert.go:140 — slackwebhook.renderTable has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 9 (17 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 · Handler.handleUpdateModel (cognitive 42) · ×1
  • Handler.handleUpdateModel (cognitive 42) web/backend/api/models.go:742 — Handler.handleUpdateModel has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 5 (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 · TelegramChannel.SendMedia (cognitive 41) · ×1
  • TelegramChannel.SendMedia (cognitive 41) pkg/channels/telegram/telegram.go:627 — TelegramChannel.SendMedia has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.applyLegacySkillsSecurityNode (cognitive 41) · ×1
  • config.applyLegacySkillsSecurityNode (cognitive 41) pkg/config/security.go:126 — config.applyLegacySkillsSecurityNode has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gateway.Run (cognitive 41) · ×1
  • gateway.Run (cognitive 41) pkg/gateway/gateway.go:120 — gateway.Run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (33 pts), loops 4 (5 pts), match/switch 2 (3 pts) (nesting depth added 12). Of this number, 36 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.mergeGeminiSchemaMaps (cognitive 41) · ×1
  • common.mergeGeminiSchemaMaps (cognitive 41) pkg/providers/common/google_schema.go:331 — common.mergeGeminiSchemaMaps has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AntigravityProvider.buildRequest (cognitive 41) · ×1
  • AntigravityProvider.buildRequest (cognitive 41) REDACTED:207 — AntigravityProvider.buildRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompactionEngine.compactLeaf (cognitive 41) · ×1
  • CompactionEngine.compactLeaf (cognitive 41) pkg/seahorse/short_compaction.go:171 — CompactionEngine.compactLeaf has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 5, loops 5 (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 · api.normalizeChannelArrayFields (cognitive 41) · ×1
  • api.normalizeChannelArrayFields (cognitive 41) web/backend/api/config.go:470 — api.normalizeChannelArrayFields has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.canonicalizeSignatureValue (cognitive 41) · ×1
  • api.canonicalizeSignatureValue (cognitive 41) web/backend/api/gateway.go:745 — api.canonicalizeSignatureValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.runEval (cognitive 40) · ×1
  • main.runEval (cognitive 40) cmd/membench/main.go:168 — main.runEval has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.resolveMediaRefs (cognitive 40) · ×1
  • agent.resolveMediaRefs (cognitive 40) pkg/agent/agent_media.go:60 — agent.resolveMediaRefs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (33 pts), boolean chains 4, 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 · Manager.StartAll (cognitive 40) · ×1
  • Manager.StartAll (cognitive 40) pkg/channels/manager.go:1214 — Manager.StartAll has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 19). Of this number, 24 points are the body's own statements and 16 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 · TelegramChannel.handleMessages (cognitive 40) · ×1
  • TelegramChannel.handleMessages (cognitive 40) pkg/channels/telegram/telegram.go:1036 — TelegramChannel.handleMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 11). Of this number, 35 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 · catalog-dialog.CatalogDialog (cognitive 40) · ×1
  • catalog-dialog.CatalogDialog (cognitive 40) web/frontend/src/components/models/catalog-dialog.tsx:45 — catalog-dialog.CatalogDialog has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 19, ternaries 7 (10 pts), if/else 7, error handling 3, loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 40 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 204, handleAddSelected, a function literal at line 62, …). 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 · DeltaChatChannel.handleMessage (cognitive 39) · ×1
  • DeltaChatChannel.handleMessage (cognitive 39) pkg/channels/deltachat/handler.go:60 — DeltaChatChannel.handleMessage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28 (35 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SogouSearchProvider.Search (cognitive 39) · ×1
  • SogouSearchProvider.Search (cognitive 39) pkg/tools/integration/web.go:879 — SogouSearchProvider.Search has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecTool.executeRun (cognitive 39) · ×1
  • ExecTool.executeRun (cognitive 39) pkg/tools/shell.go:295 — ExecTool.executeRun has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 5, match/switch 1 (nesting depth added 13). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool-calls.parseToolCallsValue (cognitive 39) · ×1
  • tool-calls.parseToolCallsValue (cognitive 39) web/frontend/src/features/chat/tool-calls.ts:39 — tool-calls.parseToolCallsValue has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (18 pts), if/else 7 (15 pts), boolean chains 5, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manager.runTTLJanitor (cognitive 38) · ×1
  • Manager.runTTLJanitor (cognitive 38) pkg/channels/manager.go:1824 — Manager.runTTLJanitor has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (34 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 26). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1833, 1843, 1853, …). 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 · WeComChannel.resolveOutboundPart (cognitive 38) · ×1
  • WeComChannel.resolveOutboundPart (cognitive 38) REDACTED:459 — WeComChannel.resolveOutboundPart has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 2, match/switch 1 (nesting depth added 18). 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 · netbind.BuildPlan (cognitive 37) · ×1
  • netbind.BuildPlan (cognitive 37) pkg/netbind/netbind.go:184 — netbind.BuildPlan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 2 (4 pts), loops 3, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexProvider.Chat (cognitive 37) · ×1
  • CodexProvider.Chat (cognitive 37) pkg/providers/oauth/codex_provider.go:58 — CodexProvider.Chat has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.applyConfigSecretsFromMap (cognitive 37) · ×1
  • api.applyConfigSecretsFromMap (cognitive 37) web/backend/api/config.go:654 — api.applyConfigSecretsFromMap has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseChannel.HandleMessageWithContext (cognitive 36) · ×1
  • BaseChannel.HandleMessageWithContext (cognitive 36) pkg/channels/base.go:263 — BaseChannel.HandleMessageWithContext has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (32 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 · DiscordChannel.handleMessage (cognitive 36) · ×1
  • DiscordChannel.handleMessage (cognitive 36) pkg/channels/discord/discord.go:524 — DiscordChannel.handleMessage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). Of this number, 33 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LINEChannel.stripBotMention (cognitive 36) · ×1
  • LINEChannel.stripBotMention (cognitive 36) pkg/channels/line/line.go:386 — LINEChannel.stripBotMention has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · tools.RunToolLoop (cognitive 36) · ×1
  • tools.RunToolLoop (cognitive 36) pkg/tools/toolloop.go:43 — tools.RunToolLoop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (11 pts), boolean chains 2 (nesting depth added 18). Of this number, 29 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstallSkillTool.Execute (cognitive 36) · ×1
  • InstallSkillTool.Execute (cognitive 36) pkg/tools/integration/skills_install.go:76 — InstallSkillTool.Execute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27 (36 pts) (nesting depth added 9). Of this number, 33 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · modelProbeCacheState.gc (cognitive 36) · ×1
  • modelProbeCacheState.gc (cognitive 36) web/backend/api/model_status.go:353 — modelProbeCacheState.gc has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 6 (10 pts), boolean chains 6 (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 · LLMClient.Complete (cognitive 35) · ×1
  • LLMClient.Complete (cognitive 35) cmd/membench/llm_client.go:81 — LLMClient.Complete has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · audio.DecodeOggOpus (cognitive 35) · ×1
  • audio.DecodeOggOpus (cognitive 35) pkg/audio/ogg.go:11 — audio.DecodeOggOpus has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SkillsRegistriesConfig.UnmarshalJSON (cognitive 35) · ×1
  • SkillsRegistriesConfig.UnmarshalJSON (cognitive 35) pkg/config/config_struct.go:360 — SkillsRegistriesConfig.UnmarshalJSON has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (10 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 · skills.skillsListBuiltinCmd (cognitive 34) · ×1
  • skills.skillsListBuiltinCmd (cognitive 34) cmd/picoclaw/internal/skills/helpers.go:218 — skills.skillsListBuiltinCmd has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (33 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 · Pipeline.SetupTurn (cognitive 34) · ×1
  • Pipeline.SetupTurn (cognitive 34) pkg/agent/pipeline_setup.go:16 — Pipeline.SetupTurn has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 7 (nesting depth added 11). Of this number, 30 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 · qq.qqWAVDuration (cognitive 34) · ×1
  • qq.qqWAVDuration (cognitive 34) pkg/channels/qq/audio_duration.go:58 — qq.qqWAVDuration has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 2 (3 pts), boolean chains 2, 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 · WeComChannel.SendMedia (cognitive 34) · ×1
  • WeComChannel.SendMedia (cognitive 34) pkg/channels/wecom/wecom.go:222 — WeComChannel.SendMedia has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 1 (nesting depth added 18). Of this number, 16 points are the body's own statements and 18 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 · TavilySearchProvider.Search (cognitive 34) · ×1
  • TavilySearchProvider.Search (cognitive 34) pkg/tools/integration/web.go:394 — TavilySearchProvider.Search has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LINEChannel.processEvent (cognitive 33) · ×1
  • LINEChannel.processEvent (cognitive 33) pkg/channels/line/line.go:179 — LINEChannel.processEvent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LINEChannel.isBotMentioned (cognitive 33) · ×1
  • LINEChannel.isBotMentioned (cognitive 33) pkg/channels/line/line.go:349 — LINEChannel.isBotMentioned has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (25 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AntigravityProvider.parseSSEResponse (cognitive 33) · ×1
  • AntigravityProvider.parseSSEResponse (cognitive 33) REDACTED:354 — AntigravityProvider.parseSSEResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 3 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BraveSearchProvider.Search (cognitive 33) · ×1
  • BraveSearchProvider.Search (cognitive 33) pkg/tools/integration/web.go:278 — BraveSearchProvider.Search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatrixChannel.SendMedia (cognitive 32) · ×1
  • MatrixChannel.SendMedia (cognitive 32) pkg/channels/matrix/matrix.go:456 — MatrixChannel.SendMedia has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel.resolveOutboundPart (cognitive 32) · ×1
  • WeixinChannel.resolveOutboundPart (cognitive 32) REDACTED:694 — WeixinChannel.resolveOutboundPart has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2, match/switch 1 (nesting depth added 15). 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 · skills.parseGitHubTargetWithBaseURL (cognitive 32) · ×1
  • skills.parseGitHubTargetWithBaseURL (cognitive 32) pkg/skills/installer.go:251 — skills.parseGitHubTargetWithBaseURL has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KagiSearchProvider.Search (cognitive 32) · ×1
  • KagiSearchProvider.Search (cognitive 32) pkg/tools/integration/web.go:511 — KagiSearchProvider.Search has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 4, 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 · chat-page.ChatPage (cognitive 32) · ×1
  • chat-page.ChatPage (cognitive 32) web/frontend/src/components/chat/chat-page.tsx:103 — chat-page.ChatPage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 9, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 13 function items inside it that branch (handleSend, a function literal at line 184, appendImageFiles, …). 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 · auth.authLogoutCmd (cognitive 31) · ×1
  • auth.authLogoutCmd (cognitive 31) cmd/picoclaw/internal/auth/helpers.go:333 — auth.authLogoutCmd has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.inferSkillNamesFromToolCall (cognitive 31) · ×1
  • agent.inferSkillNamesFromToolCall (cognitive 31) pkg/agent/pipeline_execute.go:34 — agent.inferSkillNamesFromToolCall has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 6, 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 · agent.spawnSubTurn (cognitive 31) · ×1
  • agent.spawnSubTurn (cognitive 31) pkg/agent/subturn.go:269 — agent.spawnSubTurn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (28 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 6 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 · feishu.extractImageKeysRecursive (cognitive 31) · ×1
  • feishu.extractImageKeysRecursive (cognitive 31) pkg/channels/feishu/common.go:170 — feishu.extractImageKeysRecursive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 18). 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 · qq.qqOggDuration (cognitive 31) · ×1
  • qq.qqOggDuration (cognitive 31) pkg/channels/qq/audio_duration.go:140 — qq.qqOggDuration has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · weixin.PerformLoginInteractive (cognitive 31) · ×1
  • weixin.PerformLoginInteractive (cognitive 31) pkg/channels/weixin/auth.go:25 — weixin.PerformLoginInteractive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (5 pts), boolean chains 1, 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 · LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cognitive 31) · ×1
  • LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cognitive 31) REDACTED:460 — LLMPatternClusterer.validateAndBuildPatternsWithEvidence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RetrievalEngine.Grep (cognitive 31) · ×1
  • RetrievalEngine.Grep (cognitive 31) pkg/seahorse/short_retrieval.go:95 — RetrievalEngine.Grep has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session.buildSessionScope (cognitive 31) · ×1
  • session.buildSessionScope (cognitive 31) pkg/session/allocator.go:45 — session.buildSessionScope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadFileTool.Execute (cognitive 31) · ×1
  • ReadFileTool.Execute (cognitive 31) pkg/tools/fs/filesystem.go:395 — ReadFileTool.Execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · MCPTool.normalizeResultContent (cognitive 31) · ×1
  • MCPTool.normalizeResultContent (cognitive 31) pkg/tools/integration/mcp_tool.go:361 — MCPTool.normalizeResultContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.handleTestInlineModel (cognitive 31) · ×1
  • Handler.handleTestInlineModel (cognitive 31) web/backend/api/models.go:1493 — Handler.handleTestInlineModel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 5 (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 · generic-form.GenericForm (cognitive 31) · ×1
  • generic-form.GenericForm (cognitive 31) web/frontend/src/components/channels/channel-forms/generic-form.tsx:79 — generic-form.GenericForm has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 22, if/else 7, ternaries 1 (2 pts) (nesting depth added 1). Of this number, 20 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · assistant-message.AssistantMessage (cognitive 31) · ×1
  • assistant-message.AssistantMessage (cognitive 31) web/frontend/src/components/chat/assistant-message.tsx:41 — assistant-message.AssistantMessage has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 28, ternaries 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 · mcp.parseAddArgs (cognitive 30) · ×1
  • mcp.parseAddArgs (cognitive 30) cmd/picoclaw/internal/mcp/add.go:85 — mcp.parseAddArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pipeline.tryConfiguredStreamingLLM (cognitive 30) · ×1
  • Pipeline.tryConfiguredStreamingLLM (cognitive 30) pkg/agent/pipeline_streaming.go:17 — Pipeline.tryConfiguredStreamingLLM has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 4 (nesting depth added 10). Of this number, 24 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeltaChatChannel.ensureAccount (cognitive 30) · ×1
  • DeltaChatChannel.ensureAccount (cognitive 30) pkg/channels/deltachat/deltachat.go:955 — DeltaChatChannel.ensureAccount has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel.SendMedia (cognitive 30) · ×1
  • DiscordChannel.SendMedia (cognitive 30) pkg/channels/discord/discord.go:261 — DiscordChannel.SendMedia has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeishuChannel.Send (cognitive 30) · ×1
  • FeishuChannel.Send (cognitive 30) REDACTED:155 — FeishuChannel.Send has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (30 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 · OneBotChannel.listen (cognitive 30) · ×1
  • OneBotChannel.listen (cognitive 30) pkg/channels/onebot/onebot.go:605 — OneBotChannel.listen has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · providers.ResolveModelConfig (cognitive 30) · ×1
  • providers.ResolveModelConfig (cognitive 30) pkg/providers/legacy_provider.go:18 — providers.ResolveModelConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8, 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 · tools.NewExecToolWithConfig (cognitive 30) · ×1
  • tools.NewExecToolWithConfig (cognitive 30) pkg/tools/shell.go:143 — tools.NewExecToolWithConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (6 pts), boolean chains 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 · tools.encodeKeyToken (cognitive 30) · ×1
  • tools.encodeKeyToken (cognitive 30) pkg/tools/shell.go:960 — tools.encodeKeyToken has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhatsAppNativeChannel.Start (cognitive 30) · ×1
  • WhatsAppNativeChannel.Start (cognitive 30) pkg/channels/whatsapp_native/whatsapp_native.go:85 — WhatsAppNativeChannel.Start has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 13). Of this number, 15 points are the body's own statements and 15 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 · Pipeline.applyBeforeLLMModelRewrite (cognitive 29) · ×1
  • Pipeline.applyBeforeLLMModelRewrite (cognitive 29) pkg/agent/pipeline_llm.go:730 — Pipeline.applyBeforeLLMModelRewrite has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 5 (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 · Manager.runWorker (cognitive 29) · ×1
  • Manager.runWorker (cognitive 29) pkg/channels/manager.go:1461 — Manager.runWorker has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (9 pts), match/switch 1 (2 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 · MigrateInstance.Execute (cognitive 29) · ×1
  • MigrateInstance.Execute (cognitive 29) pkg/migrate/migrate.go:174 — MigrateInstance.Execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FallbackChain.ExecuteCandidate (cognitive 29) · ×1
  • FallbackChain.ExecuteCandidate (cognitive 29) pkg/providers/fallback.go:141 — FallbackChain.ExecuteCandidate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (28 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 · ExecTool.runSync (cognitive 29) · ×1
  • ExecTool.runSync (cognitive 29) pkg/tools/shell.go:386 — ExecTool.runSync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 pts), match/switch 2 (3 pts) (nesting depth added 9). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpawnStatusTool.Execute (cognitive 29) · ×1
  • SpawnStatusTool.Execute (cognitive 29) pkg/tools/spawn_status.go:51 — SpawnStatusTool.Execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, loops 4 (nesting depth added 7). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch 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.handleSearchSkills (cognitive 29) · ×1
  • Handler.handleSearchSkills (cognitive 29) web/backend/api/skills.go:172 — Handler.handleSearchSkills has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 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 · Handler.handleUpdateWebSearchConfig (cognitive 29) · ×1
  • Handler.handleUpdateWebSearchConfig (cognitive 29) web/backend/api/tools.go:419 — Handler.handleUpdateWebSearchConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · edit-model-sheet.EditModelSheet · ×1
  • edit-model-sheet.EditModelSheet::handleSave (cognitive 29) web/frontend/src/components/models/edit-model-sheet.tsx:327 — edit-model-sheet.EditModelSheet::handleSave has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 11, if/else 9, ternaries 5 (6 pts), error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (edit-model-sheet.EditModelSheet) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · auth.authLoginPasteToken (cognitive 28) · ×1
  • auth.authLoginPasteToken (cognitive 28) cmd/picoclaw/internal/auth/helpers.go:268 — auth.authLoginPasteToken has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.normalizeProcessOptions (cognitive 28) · ×1
  • agent.normalizeProcessOptions (cognitive 28) pkg/agent/dispatch_request.go:65 — agent.normalizeProcessOptions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel.handleVoiceCommand (cognitive 28) · ×1
  • DiscordChannel.handleVoiceCommand (cognitive 28) pkg/channels/discord/voice.go:44 — DiscordChannel.handleVoiceCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatrixChannel.handleMessageEvent (cognitive 28) · ×1
  • MatrixChannel.handleMessageEvent (cognitive 28) pkg/channels/matrix/matrix.go:772 — MatrixChannel.handleMessageEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · WeixinChannel.handleInboundMessage (cognitive 28) · ×1
  • WeixinChannel.handleInboundMessage (cognitive 28) pkg/channels/weixin/weixin.go:286 — WeixinChannel.handleInboundMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.applySkillsRegistryEnvCompat (cognitive 28) · ×1
  • config.applySkillsRegistryEnvCompat (cognitive 28) REDACTED:1554 — config.applySkillsRegistryEnvCompat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23 (28 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · bedrock.parseResponse (cognitive 28) · ×1
  • bedrock.parseResponse (cognitive 28) pkg/providers/bedrock/provider_bedrock.go:724 — bedrock.parseResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (5 pts), loops 1 (3 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · fstools.validatePathWithAllowPaths (cognitive 28) · ×1
  • fstools.validatePathWithAllowPaths (cognitive 28) pkg/tools/fs/filesystem.go:39 — fstools.validatePathWithAllowPaths has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (28 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.computeConfigSignature (cognitive 28) · ×1
  • api.computeConfigSignature (cognitive 28) web/backend/api/gateway.go:421 — api.computeConfigSignature has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27 (28 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · add-model-sheet.AddModelSheet (cognitive 28) · ×1
  • add-model-sheet.AddModelSheet (cognitive 28) web/frontend/src/components/models/add-model-sheet.tsx:107 — add-model-sheet.AddModelSheet has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 37, if/else 27 (28 pts), ternaries 12 (13 pts), error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (add-model-sheet.AddModelSheet::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · edit-model-sheet.EditModelSheet (cognitive 28) · ×1
  • edit-model-sheet.EditModelSheet (cognitive 28) web/frontend/src/components/models/edit-model-sheet.tsx:114 — edit-model-sheet.EditModelSheet has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 35, if/else 21 (22 pts), ternaries 15 (16 pts), error handling 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (edit-model-sheet.EditModelSheet::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · agent.resolveActiveModelConfig (cognitive 27) · ×1
  • agent.resolveActiveModelConfig (cognitive 27) pkg/agent/model_resolution.go:290 — agent.resolveActiveModelConfig has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextBuilder.BuildMessagesFromPrompt (cognitive 27) · ×1
  • ContextBuilder.BuildMessagesFromPrompt (cognitive 27) pkg/agent/context.go:842 — ContextBuilder.BuildMessagesFromPrompt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel.downloadMediaFromItem (cognitive 27) · ×1
  • WeixinChannel.downloadMediaFromItem (cognitive 27) REDACTED:516 — WeixinChannel.downloadMediaFromItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 25 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp.connectServer (cognitive 27) · ×1
  • mcp.connectServer (cognitive 27) pkg/mcp/manager.go:324 — mcp.connectServer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (9 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bedrock.buildUserContent (cognitive 27) · ×1
  • bedrock.buildUserContent (cognitive 27) pkg/providers/bedrock/provider_bedrock.go:539 — bedrock.buildUserContent has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · geminiSchemaSanitizer.mergeUnionBranches (cognitive 27) · ×1
  • geminiSchemaSanitizer.mergeUnionBranches (cognitive 27) pkg/providers/common/google_schema.go:168 — geminiSchemaSanitizer.mergeUnionBranches has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.IsPrivateOrRestrictedIP (cognitive 27) · ×1
  • utils.IsPrivateOrRestrictedIP (cognitive 27) pkg/utils/http_guard.go:252 — utils.IsPrivateOrRestrictedIP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 13 (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 · Handler.handleListSessions (cognitive 27) · ×1
  • Handler.handleListSessions (cognitive 27) web/backend/api/session.go:820 — Handler.handleListSessions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, 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 · DiscordChannel.playTTS (cognitive 26) · ×1
  • DiscordChannel.playTTS (cognitive 26) pkg/channels/discord/discord.go:883 — DiscordChannel.playTTS has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 12). Of this number, 19 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 · OneBotChannel.handleMessage (cognitive 26) · ×1
  • OneBotChannel.handleMessage (cognitive 26) pkg/channels/onebot/onebot.go:931 — OneBotChannel.handleMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WeComChannel.collectMixedMedia (cognitive 26) · ×1
  • WeComChannel.collectMixedMedia (cognitive 26) pkg/channels/wecom/wecom.go:632 — WeComChannel.collectMixedMedia has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.mergeModelListsWithMap (cognitive 26) · ×1
  • config.mergeModelListsWithMap (cognitive 26) pkg/config/migration.go:497 — config.mergeModelListsWithMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · USBMonitor.Start (cognitive 26) · ×1
  • USBMonitor.Start (cognitive 26) pkg/devices/sources/usb_linux.go:50 — USBMonitor.Start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (5 pts), boolean chains 2, loops 1 (nesting depth added 13). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). 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 · memory.MigrateFromJSON (cognitive 26) · ×1
  • memory.MigrateFromJSON (cognitive 26) pkg/memory/migration.go:31 — memory.MigrateFromJSON has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FallbackChain.ExecuteImageCandidate (cognitive 26) · ×1
  • FallbackChain.ExecuteImageCandidate (cognitive 26) pkg/providers/fallback.go:298 — FallbackChain.ExecuteImageCandidate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.normalizeStoredModelConfig (cognitive 26) · ×1
  • api.normalizeStoredModelConfig (cognitive 26) web/backend/api/models.go:78 — api.normalizeStoredModelConfig has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 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 · cliui.printMCPShowFancy (cognitive 25) · ×1
  • cliui.printMCPShowFancy (cognitive 25) cmd/picoclaw/internal/cliui/mcp_show.go:133 — cliui.printMCPShowFancy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 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 · AgentLoop.ReloadProviderAndConfig (cognitive 25) · ×1
  • AgentLoop.ReloadProviderAndConfig (cognitive 25) pkg/agent/agent.go:376 — AgentLoop.ReloadProviderAndConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (24 pts), loops 1 (nesting depth added 6). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel.uploadBufferToCDN (cognitive 25) · ×1
  • WeixinChannel.uploadBufferToCDN (cognitive 25) REDACTED:834 — WeixinChannel.uploadBufferToCDN has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, loops 1 (nesting depth added 11). Of this number, 15 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 · SkillRegistryConfig.UnmarshalJSON (cognitive 25) · ×1
  • SkillRegistryConfig.UnmarshalJSON (cognitive 25) pkg/config/config_struct.go:445 — SkillRegistryConfig.UnmarshalJSON has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 2 (3 pts), match/switch 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 · FileMediaStore.CleanExpired (cognitive 25) · ×1
  • FileMediaStore.CleanExpired (cognitive 25) pkg/media/store.go:217 — FileMediaStore.CleanExpired has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2, boolean chains 1 (nesting depth added 14). 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 · common.geminiSchemaBranchType (cognitive 25) · ×1
  • common.geminiSchemaBranchType (cognitive 25) pkg/providers/common/google_schema.go:425 — common.geminiSchemaBranchType has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 14). 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 · openai_responses_common.TranslateMessages (cognitive 25) · ×1
  • openai_responses_common.TranslateMessages (cognitive 25) pkg/providers/openai_responses_common/responses_common.go:21 — openai_responses_common.TranslateMessages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerplexitySearchProvider.Search (cognitive 25) · ×1
  • PerplexitySearchProvider.Search (cognitive 25) pkg/tools/integration/web.go:1081 — PerplexitySearchProvider.Search has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 2, 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 · updater.extractTarFromReader (cognitive 25) · ×1
  • updater.extractTarFromReader (cognitive 25) REDACTED:626 — updater.extractTarFromReader has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · add-model-sheet.AddModelSheet · ×1
  • add-model-sheet.AddModelSheet::handleSave (cognitive 25) web/frontend/src/components/models/add-model-sheet.tsx:353 — add-model-sheet.AddModelSheet::handleSave has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 5 (6 pts), error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (add-model-sheet.AddModelSheet) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · cliui.printMCPShowPlain (cognitive 24) · ×1
  • cliui.printMCPShowPlain (cognitive 24) cmd/picoclaw/internal/cliui/mcp_show.go:51 — cliui.printMCPShowPlain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 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 · feishu.extractPostImageKeys (cognitive 24) · ×1
  • feishu.extractPostImageKeys (cognitive 24) pkg/channels/feishu/common.go:70 — feishu.extractPostImageKeys has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (4 pts) (nesting depth added 12). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 83). 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 · PicoChannel.SendMedia (cognitive 24) · ×1
  • PicoChannel.SendMedia (cognitive 24) REDACTED:748 — PicoChannel.SendMedia has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JSONLStore.ResolveSessionKey (cognitive 24) · ×1
  • JSONLStore.ResolveSessionKey (cognitive 24) pkg/memory/jsonl.go:295 — JSONLStore.ResolveSessionKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.serializeToolCalls (cognitive 24) · ×1
  • common.serializeToolCalls (cognitive 24) pkg/providers/common/common.go:159 — common.serializeToolCalls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.handleGetSession (cognitive 24) · ×1
  • Handler.handleGetSession (cognitive 24) web/backend/api/session.go:900 — Handler.handleGetSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 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 · main.launcherConsoleHostsWithLocalAddrs (cognitive 24) · ×1
  • main.launcherConsoleHostsWithLocalAddrs (cognitive 24) REDACTED:249 — main.launcherConsoleHostsWithLocalAddrs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · form-model.buildFormFromConfig (cognitive 24) · ×1
  • form-model.buildFormFromConfig (cognitive 24) web/frontend/src/components/config/form-model.ts:291 — form-model.buildFormFromConfig has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 19, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · model.pickModel (cognitive 23) · ×1
  • model.pickModel (cognitive 23) cmd/picoclaw/internal/model/add.go:120 — model.pickModel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.skillFilesChangedSince (cognitive 23) · ×1
  • agent.skillFilesChangedSince (cognitive 23) pkg/agent/context.go:688 — agent.skillFilesChangedSince has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 2, boolean chains 1 (nesting depth added 10). Of this number, 14 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · audio.SplitSentences (cognitive 23) · ×1
  • audio.SplitSentences (cognitive 23) pkg/audio/sentence.go:12 — audio.SplitSentences has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, 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 · SlackChannel.handleMessageEvent (cognitive 23) · ×1
  • SlackChannel.handleMessageEvent (cognitive 23) pkg/channels/slack/slack.go:313 — SlackChannel.handleMessageEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). Of this number, 20 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · TeamsWebhookChannel.buildAdaptiveCard (cognitive 23) · ×1
  • TeamsWebhookChannel.buildAdaptiveCard (cognitive 23) pkg/channels/teams_webhook/teams_webhook.go:195 — TeamsWebhookChannel.buildAdaptiveCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · commands.showMCPToolsHandler (cognitive 23) · ×1
  • commands.showMCPToolsHandler (cognitive 23) pkg/commands/handler_mcp.go:46 — commands.showMCPToolsHandler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 47). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · config.loadSecurityConfig (cognitive 23) · ×1
  • config.loadSecurityConfig (cognitive 23) pkg/config/security.go:34 — config.loadSecurityConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillRegistryConfig.UnmarshalYAML (cognitive 23) · ×1
  • SkillRegistryConfig.UnmarshalYAML (cognitive 23) pkg/config/config_struct.go:523 — SkillRegistryConfig.UnmarshalYAML has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.MarkTaskRecordsClustered (cognitive 23) · ×1
  • Store.MarkTaskRecordsClustered (cognitive 23) REDACTED:194 — Store.MarkTaskRecordsClustered has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gateway.setupConfigWatcherPolling (cognitive 23) · ×1
  • gateway.setupConfigWatcherPolling (cognitive 23) pkg/gateway/gateway.go:754 — gateway.setupConfigWatcherPolling has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 15). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 760). 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 · common.ParseResponse (cognitive 23) · ×1
  • common.ParseResponse (cognitive 23) pkg/providers/common/common.go:232 — common.ParseResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 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 · geminiSchemaSanitizer.sanitizeNode (cognitive 23) · ×1
  • geminiSchemaSanitizer.sanitizeNode (cognitive 23) pkg/providers/common/google_schema.go:52 — geminiSchemaSanitizer.sanitizeNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 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 · Provider.buildRequestBody (cognitive 23) · ×1
  • Provider.buildRequestBody (cognitive 23) pkg/providers/openai_compat/provider.go:146 — Provider.buildRequestBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitHubRegistry.Search (cognitive 23) · ×1
  • GitHubRegistry.Search (cognitive 23) pkg/skills/github_registry.go:128 — GitHubRegistry.Search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4, loops 2 (nesting depth added 2). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. 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 · CronTool.addJob (cognitive 23) · ×1
  • CronTool.addJob (cognitive 23) pkg/tools/cron.go:167 — CronTool.addJob has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7 (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 · tools.checkType (cognitive 23) · ×1
  • tools.checkType (cognitive 23) pkg/tools/validate.go:98 — tools.checkType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (5 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 · Handler.findPicoJSONLSessions (cognitive 23) · ×1
  • Handler.findPicoJSONLSessions (cognitive 23) web/backend/api/session.go:273 — Handler.findPicoJSONLSessions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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 · main.onReady (cognitive 23) · ×1
  • main.onReady (cognitive 23) web/backend/systray.go:19 — main.onReady has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 45). 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 · fetch-models-dialog.FetchModelsDialog (cognitive 23) · ×1
  • fetch-models-dialog.FetchModelsDialog (cognitive 23) web/frontend/src/components/models/fetch-models-dialog.tsx:37 — fetch-models-dialog.FetchModelsDialog has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 14, if/else 5, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 59, a function literal at line 82, a function literal at line 102, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · auth.pollWeComQRCodeResult (cognitive 22) · ×1
  • auth.pollWeComQRCodeResult (cognitive 22) cmd/picoclaw/internal/auth/wecom.go:278 — auth.pollWeComQRCodeResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (4 pts), boolean chains 2, 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 · agent.resolvedCandidateModelConfig (cognitive 22) · ×1
  • agent.resolvedCandidateModelConfig (cognitive 22) pkg/agent/instance.go:459 — agent.resolvedCandidateModelConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DingTalkChannel.onChatBotMessageReceived (cognitive 22) · ×1
  • DingTalkChannel.onChatBotMessageReceived (cognitive 22) pkg/channels/dingtalk/dingtalk.go:139 — DingTalkChannel.onChatBotMessageReceived has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FeishuChannel.handleMessageReceive (cognitive 22) · ×1
  • FeishuChannel.handleMessageReceive (cognitive 22) REDACTED:583 — FeishuChannel.handleMessageReceive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · TelegramChannel.collectTelegramMessageParts (cognitive 22) · ×1
  • TelegramChannel.collectTelegramMessageParts (cognitive 22) pkg/channels/telegram/telegram.go:1213 — TelegramChannel.collectTelegramMessageParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 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 · wecom.detectWeComMediaMetadata (cognitive 22) · ×1
  • wecom.detectWeComMediaMetadata (cognitive 22) REDACTED:219 — wecom.detectWeComMediaMetadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · cliprovider.NormalizeToolCall (cognitive 22) · ×1
  • cliprovider.NormalizeToolCall (cognitive 22) pkg/providers/cli/toolcall_utils.go:55 — cliprovider.NormalizeToolCall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.mergeUnionObjectSchemas (cognitive 22) · ×1
  • common.mergeUnionObjectSchemas (cognitive 22) pkg/providers/common/google_schema.go:271 — common.mergeUnionObjectSchemas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (10 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 · updater.extractZip (cognitive 22) · ×1
  • updater.extractZip (cognitive 22) REDACTED:552 — updater.extractZip has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 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 · utils.DownloadFile (cognitive 22) · ×1
  • utils.DownloadFile (cognitive 22) pkg/utils/media.go:76 — utils.DownloadFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · api.buildToolSupport (cognitive 22) · ×1
  • api.buildToolSupport (cognitive 22) web/backend/api/tools.go:242 — api.buildToolSupport has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · results-panel.ResultsPanel (cognitive 22) · ×1
  • results-panel.ResultsPanel (cognitive 22) web/frontend/src/components/agent/hub/results-panel.tsx:11 — results-panel.ResultsPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (21 pts), boolean chains 1 (nesting depth added 14). 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 · channel-config-page.buildSavePayload (cognitive 22) · ×1
  • channel-config-page.buildSavePayload (cognitive 22) web/frontend/src/components/channels/channel-config-page.tsx:118 — channel-config-page.buildSavePayload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.buildSeahorseContext (cognitive 21) · ×1
  • main.buildSeahorseContext (cognitive 21) cmd/membench/eval_llm.go:200 — main.buildSeahorseContext has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 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 · auth.authStatusCmd (cognitive 21) · ×1
  • auth.authStatusCmd (cognitive 21) cmd/picoclaw/internal/auth/helpers.go:384 — auth.authStatusCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cliui.FormatCLIError (cognitive 21) · ×1
  • cliui.FormatCLIError (cognitive 21) cmd/picoclaw/internal/cliui/help_error.go:12 — cliui.FormatCLIError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop.sideQuestionModelConfig (cognitive 21) · ×1
  • AgentLoop.sideQuestionModelConfig (cognitive 21) pkg/agent/turn_coord.go:663 — AgentLoop.sideQuestionModelConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · channels.dispatchLoop (cognitive 21) · ×1
  • channels.dispatchLoop (cognitive 21) pkg/channels/manager.go:1627 — channels.dispatchLoop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 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 · FeishuChannel.downloadInboundMedia (cognitive 21) · ×1
  • FeishuChannel.downloadInboundMedia (cognitive 21) REDACTED:808 — FeishuChannel.downloadInboundMedia has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 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 · splitMarkerStreamer.finalizeCompletedPartsLocked (cognitive 21) · ×1
  • splitMarkerStreamer.finalizeCompletedPartsLocked (cognitive 21) pkg/channels/manager.go:823 — splitMarkerStreamer.finalizeCompletedPartsLocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1, loops 1 (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 · CronService.executeJobByID (cognitive 21) · ×1
  • CronService.executeJobByID (cognitive 21) pkg/cron/service.go:214 — CronService.executeJobByID has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · netbind.DetectIPFamilies (cognitive 21) · ×1
  • netbind.DetectIPFamilies (cognitive 21) pkg/netbind/netbind.go:77 — netbind.DetectIPFamilies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 10). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 78). 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 · seahorse.partsMatch (cognitive 21) · ×1
  • seahorse.partsMatch (cognitive 21) pkg/seahorse/short_engine.go:793 — seahorse.partsMatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrepTool.Execute (cognitive 21) · ×1
  • GrepTool.Execute (cognitive 21) pkg/seahorse/tool_grep.go:114 — GrepTool.Execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MessageTool.buildMediaParts (cognitive 21) · ×1
  • MessageTool.buildMediaParts (cognitive 21) pkg/tools/integration/message.go:275 — MessageTool.buildMediaParts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.TruncateContextSmart (cognitive 21) · ×1
  • utils.TruncateContextSmart (cognitive 21) pkg/utils/context.go:91 — utils.TruncateContextSmart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.DoRequestWithRetry (cognitive 21) · ×1
  • utils.DoRequestWithRetry (cognitive 21) pkg/utils/http_retry.go:23 — utils.DoRequestWithRetry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 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 · Handler.handlePatchConfig (cognitive 21) · ×1
  • Handler.handlePatchConfig (cognitive 21) web/backend/api/config.go:134 — Handler.handlePatchConfig 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 · protocol.parseAttachments (cognitive 21) · ×1
  • protocol.parseAttachments (cognitive 21) web/frontend/src/features/chat/protocol.ts:22 — protocol.parseAttachments has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 3 (5 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 · main.computeModeAgg (cognitive 20) · ×1
  • main.computeModeAgg (cognitive 20) cmd/membench/eval.go:305 — main.computeModeAgg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp.extractParameters (cognitive 20) · ×1
  • mcp.extractParameters (cognitive 20) cmd/picoclaw/internal/mcp/show.go:70 — mcp.extractParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · onboard.onboard (cognitive 20) · ×1
  • onboard.onboard (cognitive 20) cmd/picoclaw/internal/onboard/helpers.go:17 — onboard.onboard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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 · agent.summarizeMCPToolParameters (cognitive 20) · ×1
  • agent.summarizeMCPToolParameters (cognitive 20) pkg/agent/agent_command.go:423 — agent.summarizeMCPToolParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tts.SynthesizeAndStore (cognitive 20) · ×1
  • tts.SynthesizeAndStore (cognitive 20) pkg/audio/tts/tts.go:89 — tts.SynthesizeAndStore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 2 (nesting depth added 1). 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: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · auth.LoginBrowserWithOptions (cognitive 20) · ×1
  • auth.LoginBrowserWithOptions (cognitive 20) REDACTED:91 — auth.LoginBrowserWithOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (nesting depth added 7). 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 · auth.extractAccountID (cognitive 20) · ×1
  • auth.extractAccountID (cognitive 20) REDACTED:609 — auth.extractAccountID has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel.listenVoiceControl (cognitive 20) · ×1
  • DiscordChannel.listenVoiceControl (cognitive 20) pkg/channels/discord/discord.go:861 — DiscordChannel.listenVoiceControl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (15 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMPatternClusterer.validateAndBuildPatterns (cognitive 20) · ×1
  • LLMPatternClusterer.validateAndBuildPatterns (cognitive 20) REDACTED:402 — LLMPatternClusterer.validateAndBuildPatterns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (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 · isolation.Preflight (cognitive 20) · ×1
  • isolation.Preflight (cognitive 20) pkg/isolation/runtime.go:324 — isolation.Preflight has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (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 · CodexCliProvider.parseJSONLEvents (cognitive 20) · ×1
  • CodexCliProvider.parseJSONLEvents (cognitive 20) pkg/providers/cli/codex_cli_provider.go:166 — CodexCliProvider.parseJSONLEvents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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 · SkillInstaller.getGithubDirAllFiles (cognitive 20) · ×1
  • SkillInstaller.getGithubDirAllFiles (cognitive 20) pkg/skills/installer.go:469 — SkillInstaller.getGithubDirAllFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), 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 · fstools.readNextLinePrefix (cognitive 20) · ×1
  • fstools.readNextLinePrefix (cognitive 20) pkg/tools/fs/filesystem.go:776 — fstools.readNextLinePrefix 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 · SubagentManager.runTask (cognitive 20) · ×1
  • SubagentManager.runTask (cognitive 20) pkg/tools/subagent.go:168 — SubagentManager.runTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.ExtractZipFile (cognitive 20) · ×1
  • utils.ExtractZipFile (cognitive 20) pkg/utils/zip.go:18 — utils.ExtractZipFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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 · api.isLikelyGatewayProcess (cognitive 20) · ×1
  • api.isLikelyGatewayProcess (cognitive 20) web/backend/api/gateway.go:161 — api.isLikelyGatewayProcess has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.RestartGateway (cognitive 20) · ×1
  • Handler.RestartGateway (cognitive 20) web/backend/api/gateway.go:1310 — Handler.RestartGateway has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.gatewayStatusData (cognitive 20) · ×1
  • Handler.gatewayStatusData (cognitive 20) web/backend/api/gateway.go:1436 — Handler.gatewayStatusData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.handleDeleteSession (cognitive 20) · ×1
  • Handler.handleDeleteSession (cognitive 20) web/backend/api/session.go:961 — Handler.handleDeleteSession has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), 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 · Handler.handleInstallSkill (cognitive 20) · ×1
  • Handler.handleInstallSkill (cognitive 20) web/backend/api/skills.go:285 — Handler.handleInstallSkill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · market-skill-card.MarketSkillCard (cognitive 20) · ×1
  • market-skill-card.MarketSkillCard (cognitive 20) web/frontend/src/components/agent/hub/market-skill-card.tsx:27 — market-skill-card.MarketSkillCard has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 4, if/else 3 (nesting depth added 1). 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: 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 · cliui.RenderCommandHelp (cognitive 19) · ×1
  • cliui.RenderCommandHelp (cognitive 19) cmd/picoclaw/internal/cliui/help_cmd.go:15 — cliui.RenderCommandHelp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (2 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 · AgentLoop.loadConfiguredHooks (cognitive 19) · ×1
  • AgentLoop.loadConfiguredHooks (cognitive 19) pkg/agent/hook_mount.go:126 — AgentLoop.loadConfiguredHooks 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). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.firstMeaningfulParagraph (cognitive 19) · ×1
  • agent.firstMeaningfulParagraph (cognitive 19) pkg/agent/discovery.go:163 — agent.firstMeaningfulParagraph has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 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 · Manager.StopAll (cognitive 19) · ×1
  • Manager.StopAll (cognitive 19) pkg/channels/manager.go:1365 — Manager.StopAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PicoChannel.Send (cognitive 19) · ×1
  • PicoChannel.Send (cognitive 19) REDACTED:298 — PicoChannel.Send has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel.isBotMentioned (cognitive 19) · ×1
  • TelegramChannel.isBotMentioned (cognitive 19) pkg/channels/telegram/telegram.go:1561 — TelegramChannel.isBotMentioned has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.InitChannelList (cognitive 19) · ×1
  • config.InitChannelList (cognitive 19) pkg/config/config_channel.go:728 — config.InitChannelList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.isProvidersMapEmpty (cognitive 19) · ×1
  • config.isProvidersMapEmpty (cognitive 19) pkg/config/config_old.go:11 — config.isProvidersMapEmpty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 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 · Runtime.normalizeDraftForWorkspace (cognitive 19) · ×1
  • Runtime.normalizeDraftForWorkspace (cognitive 19) REDACTED:766 — Runtime.normalizeDraftForWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, match/switch 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 · Runtime.applyCandidateDraft (cognitive 19) · ×1
  • Runtime.applyCandidateDraft (cognitive 19) REDACTED:1347 — Runtime.applyCandidateDraft has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 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 · providers.ClassifyError (cognitive 19) · ×1
  • providers.ClassifyError (cognitive 19) pkg/providers/error_classifier.go:151 — providers.ClassifyError has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · common.SerializeMessages (cognitive 19) · ×1
  • common.SerializeMessages (cognitive 19) pkg/providers/common/common.go:96 — common.SerializeMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 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 · openai_responses_common.parseResponse (cognitive 19) · ×1
  • openai_responses_common.parseResponse (cognitive 19) pkg/providers/openai_responses_common/responses_common.go:216 — openai_responses_common.parseResponse has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (7 pts), match/switch 3 (7 pts), if/else 3 (5 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 · CompactionEngine.selectShallowestCondensationCandidate (cognitive 19) · ×1
  • CompactionEngine.selectShallowestCondensationCandidate (cognitive 19) pkg/seahorse/short_compaction.go:459 — CompactionEngine.selectShallowestCondensationCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiSearchProvider.Search (cognitive 19) · ×1
  • GeminiSearchProvider.Search (cognitive 19) pkg/tools/integration/web.go:779 — GeminiSearchProvider.Search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · api.computeModelStreamingSignatures (cognitive 19) · ×1
  • api.computeModelStreamingSignatures (cognitive 19) web/backend/api/gateway.go:513 — api.computeModelStreamingSignatures has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateDefaultModelChain (cognitive 19) · ×1
  • api.validateDefaultModelChain (cognitive 19) web/backend/api/models.go:477 — api.validateDefaultModelChain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.fetchOpenAICompatibleModels (cognitive 19) · ×1
  • api.fetchOpenAICompatibleModels (cognitive 19) web/backend/api/models.go:1319 — api.fetchOpenAICompatibleModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models-page.modelReferenceAllowedAfterModelChange (cognitive 19) · ×1
  • models-page.modelReferenceAllowedAfterModelChange (cognitive 19) web/frontend/src/components/models/models-page.tsx:85 — models-page.modelReferenceAllowedAfterModelChange has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (7 pts), ternaries 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 3 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mcp.buildServerConfig (cognitive 18) · ×1
  • mcp.buildServerConfig (cognitive 18) cmd/picoclaw/internal/mcp/add.go:175 — mcp.buildServerConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop.runAgentLoop (cognitive 18) · ×1
  • AgentLoop.runAgentLoop (cognitive 18) pkg/agent/agent.go:528 — AgentLoop.runAgentLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent.seahorseToProviderMessages (cognitive 18) · ×1
  • agent.seahorseToProviderMessages (cognitive 18) pkg/agent/context_seahorse.go:258 — agent.seahorseToProviderMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 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 · legacyContextManager.summarizeSession (cognitive 18) · ×1
  • legacyContextManager.summarizeSession (cognitive 18) pkg/agent/context_legacy.go:174 — legacyContextManager.summarizeSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, 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 · OneBotChannel.SendMedia (cognitive 18) · ×1
  • OneBotChannel.SendMedia (cognitive 18) pkg/channels/onebot/onebot.go:454 — OneBotChannel.SendMedia has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (3 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, 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 · WeComChannel.dispatchIncoming (cognitive 18) · ×1
  • WeComChannel.dispatchIncoming (cognitive 18) pkg/channels/wecom/wecom.go:481 — WeComChannel.dispatchIncoming has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WeixinChannel.downloadCDNBuffer (cognitive 18) · ×1
  • WeixinChannel.downloadCDNBuffer (cognitive 18) REDACTED:222 — WeixinChannel.downloadCDNBuffer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 10). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhatsAppChannel.listen (cognitive 18) · ×1
  • WhatsAppChannel.listen (cognitive 18) pkg/channels/whatsapp/whatsapp.go:151 — WhatsAppChannel.listen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 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 · CronService.runLoop (cognitive 18) · ×1
  • CronService.runLoop (cognitive 18) pkg/cron/service.go:125 — CronService.runLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (6 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 · Runtime.recordsForColdPathInputs (cognitive 18) · ×1
  • Runtime.recordsForColdPathInputs (cognitive 18) REDACTED:531 — Runtime.recordsForColdPathInputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · identity.MatchAllowed (cognitive 18) · ×1
  • identity.MatchAllowed (cognitive 18) pkg/identity/identity.go:41 — identity.MatchAllowed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (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 · mcp.loadEnvFile (cognitive 18) · ×1
  • mcp.loadEnvFile (cognitive 18) pkg/mcp/manager.go:68 — mcp.loadEnvFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, 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 · MigrateInstance.Plan (cognitive 18) · ×1
  • MigrateInstance.Plan (cognitive 18) pkg/migrate/migrate.go:123 — MigrateInstance.Plan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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 · netbind.probeHostForGroups (cognitive 18) · ×1
  • netbind.probeHostForGroups (cognitive 18) pkg/netbind/netbind.go:378 — netbind.probeHostForGroups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 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 · bedrock.buildAssistantContent (cognitive 18) · ×1
  • bedrock.buildAssistantContent (cognitive 18) pkg/providers/bedrock/provider_bedrock.go:625 — bedrock.buildAssistantContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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 · api.detectConfiguredSecrets (cognitive 18) · ×1
  • api.detectConfiguredSecrets (cognitive 18) REDACTED:212 — api.detectConfiguredSecrets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.validateDefaultChainModelSet (cognitive 18) · ×1
  • api.validateDefaultChainModelSet (cognitive 18) web/backend/api/models.go:339 — api.validateDefaultChainModelSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.normalizeDefaultChainReferences (cognitive 18) · ×1
  • api.normalizeDefaultChainReferences (cognitive 18) web/backend/api/models.go:535 — api.normalizeDefaultChainReferences has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.isLikelyVersionValue (cognitive 18) · ×1
  • api.isLikelyVersionValue (cognitive 18) web/backend/api/version.go:317 — api.isLikelyVersionValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.shouldShowLocalhostConsoleEntry (cognitive 18) · ×1
  • main.shouldShowLocalhostConsoleEntry (cognitive 18) REDACTED:205 — main.shouldShowLocalhostConsoleEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 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 · config-page.ConfigPage (cognitive 18) · ×1
  • config-page.ConfigPage (cognitive 18) web/frontend/src/components/config/config-page.tsx:102 — config-page.ConfigPage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 28 (58 pts), ternaries 15 (33 pts), boolean chains 16, error handling 3 (7 pts), loops 1 (3 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (config-page.ConfigPage::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · __root.RootLayout (cognitive 18) · ×1
  • __root.RootLayout (cognitive 18) web/frontend/src/routes/__root.tsx:10 — __root.RootLayout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, ternaries 4 (6 pts), boolean chains 5 (nesting depth added 2). Of this number, 9 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentLoop.publishPicoToolCallInterim (cognitive 17) · ×1
  • AgentLoop.publishPicoToolCallInterim (cognitive 17) pkg/agent/agent_outbound.go:148 — AgentLoop.publishPicoToolCallInterim has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AgentLoop.enqueueSteeringMessage (cognitive 17) · ×1
  • AgentLoop.enqueueSteeringMessage (cognitive 17) pkg/agent/steering.go:198 — AgentLoop.enqueueSteeringMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 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 · agent.promptSourceComponent (cognitive 17) · ×1
  • agent.promptSourceComponent (cognitive 17) pkg/agent/prompt_contributors.go:164 — agent.promptSourceComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Manager.sendWithRetry (cognitive 17) · ×1
  • Manager.sendWithRetry (cognitive 17) pkg/channels/manager.go:1548 — Manager.sendWithRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 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. This shape REPEATS in the file: one other method here (Manager.sendMediaWithRetry) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Manager.sendMediaWithRetry (cognitive 17) · ×1
  • Manager.sendMediaWithRetry (cognitive 17) pkg/channels/manager.go:1738 — Manager.sendMediaWithRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 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. This shape REPEATS in the file: one other method here (Manager.sendWithRetry) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · pico.parseInlineImageValues (cognitive 17) · ×1
  • pico.parseInlineImageValues (cognitive 17) REDACTED:1285 — pico.parseInlineImageValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pico.parseInlineImageAttachments (cognitive 17) · ×1
  • pico.parseInlineImageAttachments (cognitive 17) REDACTED:1324 — pico.parseInlineImageAttachments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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 · WeComChannel.storeRemoteMedia (cognitive 17) · ×1
  • WeComChannel.storeRemoteMedia (cognitive 17) REDACTED:275 — WeComChannel.storeRemoteMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WeComChannel.readLoop (cognitive 17) · ×1
  • WeComChannel.readLoop (cognitive 17) pkg/channels/wecom/wecom.go:400 — WeComChannel.readLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.collectUnknownJSONFields (cognitive 17) · ×1
  • config.collectUnknownJSONFields (cognitive 17) pkg/config/diagnostics.go:341 — config.collectUnknownJSONFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.resolveLegacyBindingLinkedID (cognitive 17) · ×1
  • config.resolveLegacyBindingLinkedID (cognitive 17) pkg/config/legacy_bindings.go:228 — config.resolveLegacyBindingLinkedID has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · isolation.appendLinuxArgumentMounts (cognitive 17) · ×1
  • isolation.appendLinuxArgumentMounts (cognitive 17) pkg/isolation/platform_linux.go:185 — isolation.appendLinuxArgumentMounts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp.newIsolatedIOConn (cognitive 17) · ×1
  • mcp.newIsolatedIOConn (cognitive 17) pkg/mcp/isolated_command_transport.go:111 — mcp.newIsolatedIOConn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 114). 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.LoadFromMCPConfig (cognitive 17) · ×1
  • Manager.LoadFromMCPConfig (cognitive 17) pkg/mcp/manager.go:181 — Manager.LoadFromMCPConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpapi.parseGeminiResponse (cognitive 17) · ×1
  • httpapi.parseGeminiResponse (cognitive 17) pkg/providers/httpapi/gemini_provider.go:476 — httpapi.parseGeminiResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AntigravityProvider.parseAntigravityError (cognitive 17) · ×1
  • AntigravityProvider.parseAntigravityError (cognitive 17) REDACTED:661 — AntigravityProvider.parseAntigravityError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Store.ReplaceContextItemsWithSummary (cognitive 17) · ×1
  • Store.ReplaceContextItemsWithSummary (cognitive 17) REDACTED:1065 — Store.ReplaceContextItemsWithSummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tools.sanitizeIdentifierComponent (cognitive 17) · ×1
  • tools.sanitizeIdentifierComponent (cognitive 17) pkg/tools/identifier_compat.go:5 — tools.sanitizeIdentifierComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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 · hardwaretools.parseSerialWritePayload (cognitive 17) · ×1
  • hardwaretools.parseSerialWritePayload (cognitive 17) pkg/tools/hardware/serial.go:288 — hardwaretools.parseSerialWritePayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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 · integrationtools.sanitizeIdentifierComponent (cognitive 17) · ×1
  • integrationtools.sanitizeIdentifierComponent (cognitive 17) pkg/tools/integration/mcp_tool.go:92 — integrationtools.sanitizeIdentifierComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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 · BM25Engine.Search (cognitive 17) · ×1
  • BM25Engine.Search (cognitive 17) pkg/utils/bm25.go:109 — BM25Engine.Search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), match/switch 1 (2 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 · api.sessionRefFromMeta (cognitive 17) · ×1
  • api.sessionRefFromMeta (cognitive 17) web/backend/api/session.go:242 — api.sessionRefFromMeta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.parsePicoclawVersionOutput (cognitive 17) · ×1
  • api.parsePicoclawVersionOutput (cognitive 17) web/backend/api/version.go:274 — api.parsePicoclawVersionOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Handler.handleOAuthLogin (cognitive 17) · ×1
  • Handler.handleOAuthLogin (cognitive 17) web/backend/api/oauth.go:173 — Handler.handleOAuthLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 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.persistCredentialAndConfig (cognitive 17) · ×1
  • Handler.persistCredentialAndConfig (cognitive 17) web/backend/api/oauth.go:702 — Handler.persistCredentialAndConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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 · message-code-block.MessageCodeBlock (cognitive 17) · ×1
  • message-code-block.MessageCodeBlock (cognitive 17) web/frontend/src/components/chat/message-code-block.tsx:65 — message-code-block.MessageCodeBlock has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 5 (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 · main.runReport (cognitive 16) · ×1
  • main.runReport (cognitive 16) cmd/membench/main.go:275 — main.runReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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 · auth.authLoginGoogleAntigravity (cognitive 16) · ×1
  • auth.authLoginGoogleAntigravity (cognitive 16) cmd/picoclaw/internal/auth/helpers.go:95 — auth.authLoginGoogleAntigravity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cliui.styleUsageTokens (cognitive 16) · ×1
  • cliui.styleUsageTokens (cognitive 16) cmd/picoclaw/internal/cliui/help_cmd.go:196 — cliui.styleUsageTokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 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 · AgentLoop.applyExplicitSkillCommand (cognitive 16) · ×1
  • AgentLoop.applyExplicitSkillCommand (cognitive 16) pkg/agent/agent_command.go:68 — AgentLoop.applyExplicitSkillCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ContextBuilder.buildCacheBaseline (cognitive 16) · ×1
  • ContextBuilder.buildCacheBaseline (cognitive 16) pkg/agent/context.go:570 — ContextBuilder.buildCacheBaseline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 2 (nesting depth added 7). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 591). 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 · evolutionBridge.startScheduledColdPath (cognitive 16) · ×1
  • evolutionBridge.startScheduledColdPath (cognitive 16) pkg/agent/evolution_bridge.go:270 — evolutionBridge.startScheduledColdPath has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 3 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 284). 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 · ProcessHook.call (cognitive 16) · ×1
  • ProcessHook.call (cognitive 16) pkg/agent/hook_process.go:325 — ProcessHook.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel.Send (cognitive 16) · ×1
  • DiscordChannel.Send (cognitive 16) pkg/channels/discord/discord.go:164 — DiscordChannel.Send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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 · Manager.Reload (cognitive 16) · ×1
  • Manager.Reload (cognitive 16) pkg/channels/manager.go:1905 — Manager.Reload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, boolean chains 1 (nesting depth added 5). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatrixChannel.Send (cognitive 16) · ×1
  • MatrixChannel.Send (cognitive 16) pkg/channels/matrix/matrix.go:399 — MatrixChannel.Send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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 · SlackChannel.SendMedia (cognitive 16) · ×1
  • SlackChannel.SendMedia (cognitive 16) pkg/channels/slack/slack.go:176 — SlackChannel.SendMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel.startCommandRegistration (cognitive 16) · ×1
  • TelegramChannel.startCommandRegistration (cognitive 16) REDACTED:60 — TelegramChannel.startCommandRegistration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 79). 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 · WeComChannel.uploadOutboundMedia (cognitive 16) · ×1
  • WeComChannel.uploadOutboundMedia (cognitive 16) REDACTED:670 — WeComChannel.uploadOutboundMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WeixinChannel.SendMedia (cognitive 16) · ×1
  • WeixinChannel.SendMedia (cognitive 16) REDACTED:1100 — WeixinChannel.SendMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.toUniqueStrings (cognitive 16) · ×1
  • config.toUniqueStrings (cognitive 16) pkg/config/migration.go:231 — config.toUniqueStrings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runtime.filterRecordsByMinSuccessRatio (cognitive 16) · ×1
  • Runtime.filterRecordsByMinSuccessRatio (cognitive 16) REDACTED:578 — Runtime.filterRecordsByMinSuccessRatio has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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 · gateway.setupAndStartServices (cognitive 16) · ×1
  • gateway.setupAndStartServices (cognitive 16) pkg/gateway/gateway.go:406 — gateway.setupAndStartServices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15 (16 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Provider.Chat (cognitive 16) · ×1
  • Provider.Chat (cognitive 16) pkg/providers/azure/provider.go:122 — Provider.Chat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · bedrock.buildConverseParams (cognitive 16) · ×1
  • bedrock.buildConverseParams (cognitive 16) pkg/providers/bedrock/provider_bedrock.go:161 — bedrock.buildConverseParams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.resequenceContextItemsTx (cognitive 16) · ×1
  • Store.resequenceContextItemsTx (cognitive 16) REDACTED:1162 — Store.resequenceContextItemsTx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpandTool.Execute (cognitive 16) · ×1
  • ExpandTool.Execute (cognitive 16) pkg/seahorse/tool_expand.go:62 — ExpandTool.Execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · skills.extractMarkdownMetadata (cognitive 16) · ×1
  • skills.extractMarkdownMetadata (cognitive 16) pkg/skills/loader.go:273 — skills.extractMarkdownMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 6). 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 280). 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.checkEnum (cognitive 16) · ×1
  • tools.checkEnum (cognitive 16) pkg/tools/validate.go:182 — tools.checkEnum has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DuckDuckGoSearchProvider.extractResults (cognitive 16) · ×1
  • DuckDuckGoSearchProvider.extractResults (cognitive 16) pkg/tools/integration/web.go:1009 — DuckDuckGoSearchProvider.extractResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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 · ExecTool.executeSendKeys (cognitive 16) · ×1
  • ExecTool.executeSendKeys (cognitive 16) pkg/tools/shell.go:1044 — ExecTool.executeSendKeys 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 · SpawnTool.execute (cognitive 16) · ×1
  • SpawnTool.execute (cognitive 16) pkg/tools/spawn.go:83 — SpawnTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.NewSafeDialContext (cognitive 16) · ×1
  • utils.NewSafeDialContext (cognitive 16) pkg/utils/http_guard.go:131 — utils.NewSafeDialContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 136). 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 · launcherAuthHandlers.handleSetup (cognitive 16) · ×1
  • launcherAuthHandlers.handleSetup (cognitive 16) web/backend/api/auth.go:253 — launcherAuthHandlers.handleSetup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · main.shutdownApp (cognitive 16) · ×1
  • main.shutdownApp (cognitive 16) web/backend/app_runtime.go:31 — main.shutdownApp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhatsAppNativeChannel.reconnectWithBackoff (cognitive 16) · ×1
  • WhatsAppNativeChannel.reconnectWithBackoff (cognitive 16) pkg/channels/whatsapp_native/whatsapp_native.go:299 — WhatsAppNativeChannel.reconnectWithBackoff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wecom-form.WecomForm · ×1
  • wecom-form.WecomForm::renderBindSection (cognitive 16) web/frontend/src/components/channels/channel-forms/wecom-form.tsx:181 — wecom-form.WecomForm::renderBindSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · weixin-form.WeixinForm · ×1
  • weixin-form.WeixinForm::renderBindSection (cognitive 16) web/frontend/src/components/channels/channel-forms/weixin-form.tsx:160 — weixin-form.WeixinForm::renderBindSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-composer.ChatComposer (cognitive 16) · ×1
  • chat-composer.ChatComposer (cognitive 16) web/frontend/src/components/chat/chat-composer.tsx:47 — chat-composer.ChatComposer has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (5 pts), if/else 2 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · raw-config-page.RawConfigPage (cognitive 16) · ×1
  • raw-config-page.RawConfigPage (cognitive 16) web/frontend/src/components/config/raw-config-page.tsx:27 — raw-config-page.RawConfigPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4, error handling 3, boolean chains 2 (nesting depth added 3). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (handleSave, handleFormat, confirmReset, …). 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 · use-credentials-page.useCredentialsPage (cognitive 16) · ×1
  • use-credentials-page.useCredentialsPage (cognitive 16) web/frontend/src/hooks/use-credentials-page.ts:24 — use-credentials-page.useCredentialsPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (4 pts), boolean chains 2, error handling 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 6 function literals inside it that branch (lines 75, 67, 144, …). 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 · use-gateway-logs.useGatewayLogs (cognitive 16) · ×1
  • use-gateway-logs.useGatewayLogs (cognitive 16) web/frontend/src/hooks/use-gateway-logs.ts:7 — use-gateway-logs.useGatewayLogs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, error handling 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 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.
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
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: factory.go → REDACTED, migration.go, provider.go pkg/providers/factory.go — `pkg/providers/factory.go` changes together with 3 other files — `REDACTED`, `pkg/config/migration.go`, `pkg/providers/openai_compat/provider.go` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) web/backend/api/config.go:52 — web/backend/api/config.go:52-114 | web/backend/api/config.go:134-231 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (24 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (24 members, 50+ identical tokens) pkg/config/config_old.go:47 — pkg/config/config_old.go:47-66 | pkg/config/config_old.go:74-90 | pkg/config/config_old.go:98-111 | pkg/config/config_old.go:119-132 | pkg/config/config_old.go:140-153 | pkg/config/config_old.go:161-174 | pkg/config/config_old.go:182-195 | pkg/config/config_old.go:203-216 | pkg/config/config_old.go:224-237 | pkg/config/config_old.go:245-258 | pkg/config/config_old.go:266-279 | pkg/config/config_old.go:287-300 | pkg/config/config_old.go:308-321 | pkg/config/config_old.go:329-342 | pkg/config/config_old.go:350-363 | pkg/config/config_old.go:371-384 | pkg/config/config_old.go:392-402 | pkg/config/config_old.go:425-438 | pkg/config/config_old.go:446-459 | pkg/config/config_old.go:467-480 | pkg/config/config_old.go:488-501 | pkg/config/config_old.go:509-522 | pkg/config/config_old.go:530-543 | pkg/config/config_old.go:551-564 — These 24 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 24 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 24 times.
D4 · Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) pkg/channels/dingtalk/init.go:9 — pkg/channels/dingtalk/init.go:9-32 | pkg/channels/discord/init.go:10-30 | pkg/channels/feishu/init.go:9-25 | pkg/channels/line/init.go:9-25 | pkg/channels/maixcam/init.go:9-25 | pkg/channels/matrix/init.go:11-38 | pkg/channels/onebot/init.go:9-25 | pkg/channels/pico/init.go:9-54 | pkg/channels/qq/init.go:9-25 | pkg/channels/slack/init.go:9-25 | pkg/channels/slack_webhook/init.go:9-32 | pkg/channels/teams_webhook/init.go:9-32 | pkg/channels/telegram/init.go:9-25 | pkg/channels/wecom/init.go:9-25 | pkg/channels/whatsapp/init.go:9-25 | pkg/channels/whatsapp_native/init.go:11-35 — These 16 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 16 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 16 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) pkg/tools/shell.go:745 — pkg/tools/shell.go:745-772 | pkg/tools/shell.go:774-803 | pkg/tools/shell.go:805-847 | pkg/tools/shell.go:849-886 | pkg/tools/shell.go:1044-1112 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) pkg/agent/pipeline_execute.go:353 — pkg/agent/pipeline_execute.go:353-397 | pkg/agent/pipeline_execute.go:741-785 — 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 `pkg/agent/pipeline_execute.go:353` 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 (43–44 lines × 2) · ×1
  • Duplicated block (43–44 lines × 2) pkg/tools/identifier_compat.go:6 — pkg/tools/identifier_compat.go:6-48 | pkg/tools/integration/mcp_tool.go:93-136 — before extracting anything, compare `pkg/tools/identifier_compat.go` and `pkg/tools/integration/mcp_tool.go` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (42–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) pkg/agent/pipeline_execute.go:309 — pkg/agent/pipeline_execute.go:309-351 | pkg/agent/pipeline_execute.go:698-739 — 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 `pkg/agent/pipeline_execute.go:309` 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 (34–35 lines × 2) · ×1
  • Duplicated block (34–35 lines × 2) pkg/agent/pipeline_execute.go:185 — pkg/agent/pipeline_execute.go:185-219 | pkg/agent/pipeline_execute.go:478-511 — 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 `pkg/agent/pipeline_execute.go:185` 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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) pkg/routing/route.go:279 — pkg/routing/route.go:279-313 | pkg/session/key.go:147-181 — 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) pkg/tools/fs/load_image.go:89 — pkg/tools/fs/load_image.go:89-120 | pkg/tools/fs/send_file.go:86-117 — 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 `pkg/tools/fs/load_image.go:89` 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 (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) pkg/agent/pipeline_execute.go:238 — pkg/agent/pipeline_execute.go:238-266 | pkg/agent/pipeline_execute.go:618-646 — 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 `pkg/agent/pipeline_execute.go:238` 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 (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) pkg/providers/fallback.go:181 — pkg/providers/fallback.go:181-209 | pkg/providers/fallback.go:319-346 — 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 after the matched lines, `pkg/providers/fallback.go:213` calls `MarkSuccess` and `pkg/providers/fallback.go:349` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) cmd/picoclaw/internal/agent/helpers.go:115 — cmd/picoclaw/internal/agent/helpers.go:115-141 | cmd/picoclaw/internal/agent/helpers.go:150-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/picoclaw/internal/agent/helpers.go:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–26 lines × 2) · ×1
  • Duplicated block (22–26 lines × 2) cmd/membench/eval.go:132 — cmd/membench/eval.go:132-157 | cmd/membench/eval_llm.go:220-241 — 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 `cmd/membench/eval.go:132` 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, `cmd/membench/eval.go:131` calls `Printf` and `cmd/membench/eval_llm.go:219` 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) web/backend/api/config.go:89 — web/backend/api/config.go:89-114 | web/backend/api/config.go:206-231 — 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 `web/backend/api/config.go:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24–25 lines × 3) · ×1
  • Duplicated block (24–25 lines × 3) REDACTED:1325 — REDACTED:1325-1348 | REDACTED:1382-1406 | REDACTED:1440-1463 — 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:1325` 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) REDACTED:355 — REDACTED:355-378 | REDACTED:685-708 — 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 (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) REDACTED:1359 — REDACTED:1359-1381 | REDACTED:1413-1435 | REDACTED:1465-1487 — 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 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–22 lines × 2) · ×1
  • Duplicated block (13–22 lines × 2) cmd/picoclaw/internal/mcp/show.go:129 — cmd/picoclaw/internal/mcp/show.go:129-141 | pkg/agent/agent_command.go:490-511 — 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 `cmd/picoclaw/internal/mcp/show.go:129` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/show.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) pkg/channels/manager.go:1247 — pkg/channels/manager.go:1247-1266 | pkg/channels/manager.go:1967-1987 — 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 `pkg/channels/manager.go:1247` 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, `pkg/channels/manager.go:1245` calls `Errorf` and `pkg/channels/manager.go:1967` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) cmd/picoclaw/internal/auth/wecom.go:396 — cmd/picoclaw/internal/auth/wecom.go:396-415 | web/backend/api/wecom.go:329-347 — 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 `cmd/picoclaw/internal/auth/wecom.go:396` 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. 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/auth/wecom.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) cmd/picoclaw/internal/cliui/help_cmd.go:71 — cmd/picoclaw/internal/cliui/help_cmd.go:71-90 | cmd/picoclaw/internal/cliui/help_cmd.go:114-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/picoclaw/internal/cliui/help_cmd.go:71` 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.
D4 · Code Duplication · Duplicated block (11–20 lines × 2) · ×1
  • Duplicated block (11–20 lines × 2) pkg/agent/subturn.go:627 — pkg/agent/subturn.go:627-637 | pkg/session/session_store.go:15-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) pkg/providers/httpapi/types.go:14 — pkg/providers/httpapi/types.go:14-33 | pkg/providers/oauth/types.go:13-32 — `pkg/providers/httpapi/types.go` and `pkg/providers/oauth/types.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 1 separate duplicated blocks between them, totalling at least 20 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 `pkg/providers/httpapi/types.go:14` 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 (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) pkg/agent/pipeline_execute.go:410 — pkg/agent/pipeline_execute.go:410-428 | pkg/agent/pipeline_execute.go:449-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) cmd/picoclaw/internal/mcp/show.go:115 — cmd/picoclaw/internal/mcp/show.go:115-127 | pkg/agent/agent_command.go:469-486 — 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 `cmd/picoclaw/internal/mcp/show.go:115` 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/show.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) pkg/providers/fallback.go:214 — pkg/providers/fallback.go:214-230 | pkg/providers/fallback.go:349-364 — 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 `pkg/providers/fallback.go:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/providers/fallback.go:213` calls `MarkSuccess` and `pkg/providers/fallback.go:348` 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) REDACTED:186 — REDACTED:186-202 | REDACTED:278-294 — 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:186` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) pkg/agent/pipeline_execute.go:140 — pkg/agent/pipeline_execute.go:140-155 | pkg/agent/pipeline_execute.go:410-425 | pkg/agent/pipeline_execute.go:449-464 — 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 `pkg/agent/pipeline_execute.go:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) cmd/picoclaw/internal/mcp/helpers.go:292 — cmd/picoclaw/internal/mcp/helpers.go:292-306 | pkg/mcp/manager.go:30-45 — 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. Check import visibility before settling on that home: `cmd/picoclaw/internal/mcp/helpers.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) web/backend/api/model_catalog.go:60 — web/backend/api/model_catalog.go:60-70 | web/backend/api/models.go:1126-1141 — 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 `web/backend/api/model_catalog.go:60` 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 (11–15 lines × 2) · ×1
  • Duplicated block (11–15 lines × 2) pkg/providers/anthropic/provider.go:193 — pkg/providers/anthropic/provider.go:193-203 | pkg/providers/anthropic_messages/provider.go:244-258 — 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 `pkg/providers/anthropic/provider.go:193` 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 (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) pkg/agent/pipeline_execute.go:145 — pkg/agent/pipeline_execute.go:145-157 | pkg/agent/pipeline_execute.go:366-378 | pkg/agent/pipeline_execute.go:415-427 | pkg/agent/pipeline_execute.go:454-466 | pkg/agent/pipeline_execute.go:754-766 — all 5 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 `pkg/agent/pipeline_execute.go:145` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/agent/pipeline_execute.go:161` calls `denyByTurnProfile` and `pkg/agent/pipeline_execute.go:467` 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 (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) pkg/tools/fs/send_file.go:152 — pkg/tools/fs/send_file.go:152-164 | pkg/tools/integration/message.go:341-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. 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 (12 lines × 23) · ×1
  • Duplicated block (12 lines × 23) pkg/config/config_old.go:48 — pkg/config/config_old.go:48-59 | pkg/config/config_old.go:75-86 | pkg/config/config_old.go:99-110 | pkg/config/config_old.go:120-131 | pkg/config/config_old.go:141-152 | pkg/config/config_old.go:162-173 | pkg/config/config_old.go:183-194 | pkg/config/config_old.go:204-215 | pkg/config/config_old.go:225-236 | pkg/config/config_old.go:246-257 | pkg/config/config_old.go:267-278 | pkg/config/config_old.go:288-299 | pkg/config/config_old.go:309-320 | pkg/config/config_old.go:330-341 | pkg/config/config_old.go:351-362 | pkg/config/config_old.go:372-383 | pkg/config/config_old.go:426-437 | pkg/config/config_old.go:447-458 | pkg/config/config_old.go:468-479 | pkg/config/config_old.go:489-500 | pkg/config/config_old.go:510-521 | pkg/config/config_old.go:531-542 | pkg/config/config_old.go:552-563 — all 23 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) web/backend/api/models.go:770 — web/backend/api/models.go:770-780 | web/backend/api/models.go:914-924 | web/backend/api/models.go:1025-1035 | web/backend/api/models.go:1084-1094 — 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 `web/backend/api/models.go:770` 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. 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 (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) REDACTED:182 — REDACTED:182-192 | web/backend/api/tools.go:545-555 | web/backend/launcherconfig/config.go:75-85 — 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 (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) pkg/channels/discord/discord.go:453 — pkg/channels/discord/discord.go:453-462 | REDACTED:403-412 | pkg/channels/matrix/matrix.go:724-733 | pkg/channels/telegram/telegram.go:574-583 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) pkg/providers/anthropic/provider.go:389 — pkg/providers/anthropic/provider.go:389-396 | pkg/providers/anthropic_messages/provider.go:369-375 — 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 `pkg/providers/anthropic/provider.go:389` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/providers/anthropic/provider.go:387` calls `String` and `pkg/providers/anthropic_messages/provider.go:367` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 24) · ×1
  • Duplicated block (7 lines × 24) pkg/config/config_old.go:47 — pkg/config/config_old.go:47-53 | pkg/config/config_old.go:74-80 | pkg/config/config_old.go:98-104 | pkg/config/config_old.go:119-125 | pkg/config/config_old.go:140-146 | pkg/config/config_old.go:161-167 | pkg/config/config_old.go:182-188 | pkg/config/config_old.go:203-209 | pkg/config/config_old.go:224-230 | pkg/config/config_old.go:245-251 | pkg/config/config_old.go:266-272 | pkg/config/config_old.go:287-293 | pkg/config/config_old.go:308-314 | pkg/config/config_old.go:329-335 | pkg/config/config_old.go:350-356 | pkg/config/config_old.go:371-377 | pkg/config/config_old.go:392-398 | pkg/config/config_old.go:425-431 | pkg/config/config_old.go:446-452 | pkg/config/config_old.go:467-473 | pkg/config/config_old.go:488-494 | pkg/config/config_old.go:509-515 | pkg/config/config_old.go:530-536 | pkg/config/config_old.go:551-557 — all 24 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 17) · ×1
  • Duplicated block (6 lines × 17) pkg/channels/dingtalk/init.go:12 — pkg/channels/dingtalk/init.go:12-17 | pkg/channels/discord/init.go:13-18 | pkg/channels/feishu/init.go:12-17 | pkg/channels/line/init.go:12-17 | pkg/channels/maixcam/init.go:12-17 | pkg/channels/matrix/init.go:14-19 | pkg/channels/onebot/init.go:12-17 | pkg/channels/pico/init.go:12-17 | pkg/channels/pico/init.go:34-39 | pkg/channels/qq/init.go:12-17 | pkg/channels/slack/init.go:12-17 | pkg/channels/slack_webhook/init.go:12-17 | pkg/channels/teams_webhook/init.go:12-17 | pkg/channels/telegram/init.go:12-17 | pkg/channels/wecom/init.go:12-17 | pkg/channels/whatsapp/init.go:12-17 | pkg/channels/whatsapp_native/init.go:14-19 — there are 17 copies across 16 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 17 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/channels/dingtalk/init.go:12` 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 (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) web/backend/api/models.go:724 — web/backend/api/models.go:724-729 | web/backend/api/models.go:962-967 | web/backend/api/models.go:1058-1063 | web/backend/api/models.go:1107-1112 | web/backend/api/tools.go:233-238 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `web/backend/api/models.go:721` calls `normalizeStoredModelProviders`, `normalizeDefaultChainReferences` and `web/backend/api/tools.go:231` 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 (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) pkg/agent/instance.go:788 — pkg/agent/instance.go:788-800 | REDACTED:1707-1719 | pkg/migrate/internal/common.go:19-31 — 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. Check import visibility before settling on that home: `pkg/migrate/internal/common.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) pkg/channels/discord/discord.go:396 — pkg/channels/discord/discord.go:396-401 | REDACTED:334-339 | pkg/channels/manager.go:166-171 | pkg/channels/matrix/matrix.go:49-54 | REDACTED:54-59 | pkg/channels/telegram/telegram.go:517-522 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) pkg/channels/discord/discord.go:464 — pkg/channels/discord/discord.go:464-469 | REDACTED:414-419 | pkg/channels/matrix/matrix.go:735-740 — 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 × 4) · ×1
  • Duplicated block (7 lines × 4) pkg/skills/installer.go:365 — pkg/skills/installer.go:365-371 | pkg/tools/integration/web.go:820-826 | pkg/tools/integration/web.go:1324-1331 | pkg/tools/integration/web.go:1420-1427 — 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 `pkg/skills/installer.go:365` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (6 clone groups) web/frontend/src/components/agent/skills/use-skills-page.ts:264 — 6 duplicated blocks under web/frontend/src/components/ have copies in at least two of the sibling directories agent, channels, chat, config, models — 2 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (253 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (253 matched lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx:533 — web/frontend/src/components/models/add-model-sheet.tsx:533 · web/frontend/src/components/models/edit-model-sheet.tsx:507 — the two spans are one implementation copied and then locally edited — 1175 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 (221 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (221 matched lines × 2 locations) web/frontend/src/components/channels/channel-forms/wecom-form.tsx:76 — web/frontend/src/components/channels/channel-forms/wecom-form.tsx:76 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:85 — the two spans are one implementation copied and then locally edited — 1018 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 (197 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (197 matched lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx:290 — web/frontend/src/components/models/add-model-sheet.tsx:290 · web/frontend/src/components/models/edit-model-sheet.tsx:270 — the two spans are one implementation copied and then locally edited — 944 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 (60 lines × 2 locations) · ×1
  • Duplicated block (60 lines × 2 locations) web/frontend/src/components/models/models-page.tsx:543 — web/frontend/src/components/models/models-page.tsx:543 · web/frontend/src/components/models/models-page.tsx:609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (60 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (60 matched lines × 2 locations) web/frontend/src/routes/launcher-login.tsx:28 — web/frontend/src/routes/launcher-login.tsx:28 · web/frontend/src/routes/launcher-setup.tsx:25 — the two spans are one implementation copied and then locally edited — 327 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 (53 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (53 matched lines × 2 locations) web/frontend/src/components/credentials/anthropic-credential-card.tsx:19 — web/frontend/src/components/credentials/anthropic-credential-card.tsx:19 · web/frontend/src/components/credentials/openai-credential-card.tsx:22 — the two spans are one implementation copied and then locally edited — 233 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (47 lines × 2 locations) · ×1
  • Duplicated block (47 lines × 2 locations) web/frontend/src/components/models/add-model-sheet.tsx:240 — web/frontend/src/components/models/add-model-sheet.tsx:240 · web/frontend/src/components/models/edit-model-sheet.tsx:225 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) web/frontend/src/components/channels/channel-forms/discord-form.tsx:17 — web/frontend/src/components/channels/channel-forms/discord-form.tsx:17 · web/frontend/src/components/channels/channel-forms/feishu-form.tsx:18 — 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.
R10 · Code Duplication · Duplicated block with local edits (35 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (35 matched lines × 2 locations) web/frontend/src/components/channels/channel-forms/feishu-form.tsx:101 — web/frontend/src/components/channels/channel-forms/feishu-form.tsx:101 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:71 — the two spans are one implementation copied and then locally edited — 202 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) web/frontend/src/components/channels/channel-forms/generic-form.tsx:398 — web/frontend/src/components/channels/channel-forms/generic-form.tsx:398 · web/frontend/src/components/channels/channel-forms/telegram-form.tsx:137 — 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.
R10 · Code Duplication · Duplicated block (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) web/frontend/src/components/models/catalog-dialog.tsx:284 — web/frontend/src/components/models/catalog-dialog.tsx:284 · web/frontend/src/components/models/fetch-models-dialog.tsx:192 — 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.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×1
  • Duplicated block (24 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:308 — web/frontend/src/components/config/config-sections.tsx:308 · web/frontend/src/components/config/config-sections.tsx: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.
R10 · Code Duplication · Duplicated block with local edits (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) web/frontend/src/components/channels/channel-forms/wecom-form.tsx:44 — web/frontend/src/components/channels/channel-forms/wecom-form.tsx:44 · web/frontend/src/components/channels/channel-forms/weixin-form.tsx:60 — the two spans are one implementation copied and then locally edited — 150 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 (20 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (20 matched lines × 2 locations) web/frontend/src/components/agent/skills/use-skills-page.ts:264 — web/frontend/src/components/agent/skills/use-skills-page.ts:264 · web/frontend/src/components/chat/chat-page.tsx:228 — the two spans are one implementation copied and then locally edited — 114 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 (20 lines × 2 locations) · ×1
  • Duplicated block (20 lines × 2 locations) web/frontend/src/components/models/default-chain-dialog.tsx:132 — web/frontend/src/components/models/default-chain-dialog.tsx:132 · web/frontend/src/components/models/default-chain-dialog.tsx:152 — 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 (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) web/frontend/src/components/models/model-card.tsx:135 — web/frontend/src/components/models/model-card.tsx:135 · web/frontend/src/components/models/model-card.tsx:171 — 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 (16 lines × 2 locations) · ×1
  • Duplicated block (16 lines × 2 locations) web/frontend/src/components/config/config-sections.tsx:1230 — web/frontend/src/components/config/config-sections.tsx:1230 · web/frontend/src/components/config/config-sections.tsx:1256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (16 lines × 3 locations) · ×1
  • Duplicated block (16 lines × 3 locations) web/frontend/src/components/credentials/anthropic-credential-card.tsx:87 — web/frontend/src/components/credentials/anthropic-credential-card.tsx:87 · web/frontend/src/components/credentials/antigravity-credential-card.tsx:85 · web/frontend/src/components/credentials/openai-credential-card.tsx:141 — 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 (15 lines × 3 locations) · ×1
  • Duplicated block (15 lines × 3 locations) web/frontend/src/api/channels.ts:41 — web/frontend/src/api/channels.ts:41 · web/frontend/src/api/system.ts:34 · web/frontend/src/api/tools.ts:56 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (14 lines × 3 locations) · ×1
  • Duplicated block (14 lines × 3 locations) web/frontend/src/components/credentials/anthropic-credential-card.tsx:39 — web/frontend/src/components/credentials/anthropic-credential-card.tsx:39 · web/frontend/src/components/credentials/antigravity-credential-card.tsx:33 · web/frontend/src/components/credentials/openai-credential-card.tsx:46 — 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 (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) web/frontend/src/components/chat/model-selector.tsx:63 — web/frontend/src/components/chat/model-selector.tsx:63 · web/frontend/src/components/chat/model-selector.tsx:78 — 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 (13 lines × 3 locations) · ×1
  • Duplicated block (13 lines × 3 locations) web/frontend/src/components/config/config-sections.tsx:195 — web/frontend/src/components/config/config-sections.tsx:195 · web/frontend/src/components/config/config-sections.tsx:222 · web/frontend/src/components/config/config-sections.tsx:579 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function AppHeader (cyclomatic 41, cognitive 30) · ×1
  • Complex function AppHeader (cyclomatic 41, cognitive 30) web/frontend/src/components/app-header.tsx:45 — AppHeader has cyclomatic complexity 41 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ModelCard (cyclomatic 40, cognitive 36) · ×1
  • Complex function ModelCard (cyclomatic 40, cognitive 36) web/frontend/src/components/models/model-card.tsx:32 — ModelCard has cyclomatic complexity 40 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function EditModelSheet (cyclomatic 35, cognitive 32) · ×1
  • Complex function EditModelSheet (cyclomatic 35, cognitive 32) web/frontend/src/components/models/edit-model-sheet.tsx:114 — EditModelSheet has cyclomatic complexity 35 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 handleSave (cyclomatic 34, cognitive 52) · ×1
  • Complex function handleSave (cyclomatic 34, cognitive 52) web/frontend/src/components/config/config-page.tsx:295 — handleSave has cyclomatic complexity 34 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 AddModelSheet (cyclomatic 34, cognitive 30) · ×1
  • Complex function AddModelSheet (cyclomatic 34, cognitive 30) web/frontend/src/components/models/add-model-sheet.tsx:107 — AddModelSheet has cyclomatic complexity 34 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 ModelsPage (cyclomatic 34, cognitive 27) · ×1
  • Complex function ModelsPage (cyclomatic 34, cognitive 27) web/frontend/src/components/models/models-page.tsx:466 — ModelsPage has cyclomatic complexity 34 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function GenericForm (cyclomatic 33, cognitive 26) · ×1
  • Complex function GenericForm (cyclomatic 33, cognitive 26) web/frontend/src/components/channels/channel-forms/generic-form.tsx:79 — GenericForm has cyclomatic complexity 33 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 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 AssistantMessage (cyclomatic 32, cognitive 25) · ×1
  • Complex function AssistantMessage (cyclomatic 32, cognitive 25) web/frontend/src/components/chat/assistant-message.tsx:41 — AssistantMessage has cyclomatic complexity 32 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 parseAnsiSegments (cyclomatic 30, cognitive 66) · ×1
  • Complex function parseAnsiSegments (cyclomatic 30, cognitive 66) web/frontend/src/lib/ansi-log.ts:143 — parseAnsiSegments has cyclomatic complexity 30 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 handleSave (cyclomatic 27, cognitive 29) · ×1
  • Complex function handleSave (cyclomatic 27, cognitive 29) web/frontend/src/components/models/edit-model-sheet.tsx:327 — handleSave has cyclomatic complexity 27 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 parseToolCallsValue (cyclomatic 26, cognitive 48) · ×1
  • Complex function parseToolCallsValue (cyclomatic 26, cognitive 48) web/frontend/src/features/chat/tool-calls.ts:39 — parseToolCallsValue has cyclomatic complexity 26 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this 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 buildFormFromConfig (cyclomatic 25, cognitive 24) · ×1
  • Complex function buildFormFromConfig (cyclomatic 25, cognitive 24) web/frontend/src/components/config/form-model.ts:291 — buildFormFromConfig has cyclomatic complexity 25 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 handleSave (cyclomatic 23, cognitive 25) · ×1
  • Complex function handleSave (cyclomatic 23, cognitive 25) web/frontend/src/components/models/add-model-sheet.tsx:353 — handleSave has cyclomatic complexity 23 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 ConfigPage (cyclomatic 23, cognitive 16) · ×1
  • Complex function ConfigPage (cyclomatic 23, cognitive 16) web/frontend/src/components/config/config-page.tsx:102 — ConfigPage has cyclomatic complexity 23 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 handlePicoMessage (cyclomatic 22, cognitive 21) · ×1
  • Complex function handlePicoMessage (cyclomatic 22, cognitive 21) web/frontend/src/features/chat/protocol.ts:96 — handlePicoMessage 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 DetailSheet (cyclomatic 20, cognitive 19) · ×1
  • Complex function DetailSheet (cyclomatic 20, cognitive 19) web/frontend/src/components/agent/skills/detail-sheet.tsx:51 — DetailSheet has cyclomatic complexity 20 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 MessageCodeBlock (cyclomatic 20, cognitive 19) · ×1
  • Complex function MessageCodeBlock (cyclomatic 20, cognitive 19) web/frontend/src/components/chat/message-code-block.tsx:65 — MessageCodeBlock has cyclomatic complexity 20 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 MarketSkillCard (cyclomatic 18, cognitive 16) · ×1
  • Complex function MarketSkillCard (cyclomatic 18, cognitive 16) web/frontend/src/components/agent/hub/market-skill-card.tsx:27 — MarketSkillCard 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 TestModelDialog (cyclomatic 18, cognitive 13) · ×1
  • Complex function TestModelDialog (cyclomatic 18, cognitive 13) web/frontend/src/components/models/test-model-dialog.tsx:44 — TestModelDialog has cyclomatic complexity 18 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/frontend/src/components/config/config-sections.tsx · ×1
  • web/frontend/src/components/config/config-sections.tsx: 1243 lines of code web/frontend/src/components/config/config-sections.tsx:1 — web/frontend/src/components/config/config-sections.tsx has 1243 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/frontend/src/components/models/models-page.tsx · ×1
  • web/frontend/src/components/models/models-page.tsx: 1169 lines of code web/frontend/src/components/models/models-page.tsx:1 — web/frontend/src/components/models/models-page.tsx has 1169 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/frontend/src/components/config/config-page.tsx · ×1
  • web/frontend/src/components/config/config-page.tsx: 804 lines of code web/frontend/src/components/config/config-page.tsx:1 — web/frontend/src/components/config/config-page.tsx has 804 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/frontend/src/components/models/add-model-sheet.tsx · ×1
  • web/frontend/src/components/models/add-model-sheet.tsx: 801 lines of code web/frontend/src/components/models/add-model-sheet.tsx:1 — web/frontend/src/components/models/add-model-sheet.tsx has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/frontend/src/components/models/edit-model-sheet.tsx · ×1
  • web/frontend/src/components/models/edit-model-sheet.tsx: 779 lines of code web/frontend/src/components/models/edit-model-sheet.tsx:1 — web/frontend/src/components/models/edit-model-sheet.tsx has 779 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/frontend/src/components/channels/channel-config-page.tsx · ×1
  • web/frontend/src/components/channels/channel-config-page.tsx: 700 lines of code web/frontend/src/components/channels/channel-config-page.tsx:1 — web/frontend/src/components/channels/channel-config-page.tsx has 700 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/frontend/src/components/config/form-model.ts · ×1
  • web/frontend/src/components/config/form-model.ts: 498 lines of code web/frontend/src/components/config/form-model.ts:1 — web/frontend/src/components/config/form-model.ts has 498 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/frontend/src/features/chat/controller.ts · ×1
  • web/frontend/src/features/chat/controller.ts: 418 lines of code web/frontend/src/features/chat/controller.ts:1 — web/frontend/src/features/chat/controller.ts has 418 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/frontend/src/components/chat/chat-page.tsx · ×1
  • web/frontend/src/components/chat/chat-page.tsx: 413 lines of code web/frontend/src/components/chat/chat-page.tsx:1 — web/frontend/src/components/chat/chat-page.tsx has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/frontend/src/components/channels/channel-forms/generic-form.tsx · ×1
  • web/frontend/src/components/channels/channel-forms/generic-form.tsx: 404 lines of code web/frontend/src/components/channels/channel-forms/generic-form.tsx:1 — web/frontend/src/components/channels/channel-forms/generic-form.tsx has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · Test Coverage · ×1
  • Test Coverage — 0% of 150 production file(s) reachable from 0 test file(s) via the import graph — 'production' here is the RESIDUE: every source file left once tests, tooling, generated output, config, declarations and declaration-only modules, fixture corpora, type fixtures, behaviour-free data modules, re-export barrels, registration/constant data modules and service workers are set aside, so the percentage is taken over a smaller denominator than the workspace's file count
R7 · Dead Code · Dead file (~1224 LoC) · ×1
  • Dead file (~1224 LoC) web/frontend/src/components/models/models-page.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/models.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~846 LoC) · ×1
  • Dead file (~846 LoC) web/frontend/src/components/models/add-model-sheet.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/models-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~822 LoC) · ×1
  • Dead file (~822 LoC) web/frontend/src/components/models/edit-model-sheet.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/models-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~481 LoC) · ×1
  • Dead file (~481 LoC) web/frontend/src/features/chat/controller.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/hooks/use-pico-chat.ts, web/frontend/src/routes/__root.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~466 LoC) · ×1
  • Dead file (~466 LoC) web/frontend/src/components/chat/chat-page.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/index.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~436 LoC) · ×1
  • Dead file (~436 LoC) web/frontend/src/hooks/use-credentials-page.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/credentials/credentials-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~352 LoC) · ×1
  • Dead file (~352 LoC) web/frontend/src/components/models/catalog-dialog.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/models-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~340 LoC) · ×1
  • Dead file (~340 LoC) web/frontend/src/components/app-header.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-layout.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~339 LoC) · ×1
  • Dead file (~339 LoC) web/frontend/src/components/agent/skills/use-skills-page.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/skills/skills-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~303 LoC) · ×1
  • Dead file (~303 LoC) web/frontend/src/components/chat/assistant-message.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~290 LoC) · ×1
  • Dead file (~290 LoC) web/frontend/src/lib/ansi-log.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/logs/ansi-log-line.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~279 LoC) · ×1
  • Dead file (~279 LoC) web/frontend/src/components/agent/tools/web-search-provider-settings.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/web-search-tab.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~270 LoC) · ×1
  • Dead file (~270 LoC) web/frontend/src/components/agent/tools/tool-library-tab.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/tools-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~260 LoC) · ×1
  • Dead file (~260 LoC) web/frontend/src/components/app-sidebar.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-layout.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~256 LoC) · ×1
  • Dead file (~256 LoC) web/frontend/src/components/agent/skills/detail-sheet.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/skills/skills-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~242 LoC) · ×1
  • Dead file (~242 LoC) web/frontend/src/components/tour/tour-guide.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-layout.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~241 LoC) · ×1
  • Dead file (~241 LoC) web/frontend/src/hooks/use-sidebar-channels.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/app-sidebar.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~238 LoC) · ×1
  • Dead file (~238 LoC) web/frontend/src/components/models/fetch-models-dialog.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/edit-model-sheet.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~221 LoC) · ×1
  • Dead file (~221 LoC) web/frontend/src/components/config/raw-config-page.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/config.raw.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~217 LoC) · ×1
  • Dead file (~217 LoC) web/frontend/src/components/chat/chat-composer.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~209 LoC) · ×1
  • Dead file (~209 LoC) web/frontend/src/components/agent/tools/use-tools-page.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/tools-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~200 LoC) · ×1
  • Dead file (~200 LoC) web/frontend/src/components/models/default-chain-dialog.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/models/models-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~186 LoC) · ×1
  • Dead file (~186 LoC) web/frontend/src/components/chat/context-usage-ring.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-composer.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~170 LoC) · ×1
  • Dead file (~170 LoC) web/frontend/src/features/chat/image-input.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~162 LoC) · ×1
  • Dead file (~162 LoC) web/frontend/src/components/credentials/openai-credential-card.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/credentials/credentials-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~156 LoC) · ×1
  • Dead file (~156 LoC) web/frontend/src/hooks/use-chat-models.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/chat/chat-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~153 LoC) · ×1
  • Dead file (~153 LoC) web/frontend/src/components/models/provider-combobox.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/components/models/add-model-sheet.tsx, web/frontend/src/components/models/edit-model-sheet.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~136 LoC) · ×1
  • Dead file (~136 LoC) web/frontend/src/components/agent/tools/web-search-general-settings.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/tools/web-search-tab.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~132 LoC) · ×1
  • Dead file (~132 LoC) web/frontend/src/components/agent/skills/filter-bar.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/components/agent/skills/skills-page.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~127 LoC) · ×1
  • Dead file (~127 LoC) web/frontend/src/components/credentials/credentials-page.tsx — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/frontend/src/routes/credentials.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~125 LoC) · ×1
  • Dead file (~125 LoC) web/frontend/src/features/chat/tool-calls.ts — no import path from any entry point (12 application, 3 tooling, 0 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (web/frontend/src/features/chat/assistant-message-state.ts, web/frontend/src/features/chat/history.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Minor — 194 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×62
  • Orphaned file web/backend/api/wecom.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/hooks/use-credentials-page.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cmd/membench/eval_llm.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/agent/skills/use-skills-page.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/skills/registry.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/audio/asr/whisper_transcriber.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cmd/picoclaw/internal/cliui/help_cmd.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cmd/membench/metrics.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/audio/asr/agent.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/channels/vk/vk.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/seahorse/types.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/channels/telegram/parse_markdown_to_md_v2.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/lib/ansi-log.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/agent/hub/results-panel.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/agent/hub/use-hub-marketplace.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file cmd/picoclaw/internal/model/add.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/tools/spawn_status.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/providers/cooldown.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/credentials/openai-credential-card.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/skills/search_cache.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/events/bus.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/agent/skills/import-dialog.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/routes/launcher-setup.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/frontend/src/components/channels/channel-array-list-field.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 37 more in this group — see findings.md.
M4 · Documentation accuracy · README/code drift · ×40
  • README/code drift docs/README.md:59 — docs/README.md names `docs/project/CONTRIBUTING.fr.md`, but no file or folder `docs/project/CONTRIBUTING.fr.md` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/routing-system.md:193 — docs/architecture/routing-system.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/routing-system.zh.md:22 — docs/architecture/routing-system.zh.md names `pkg/agent/loop_message.go`, but no file or folder `pkg/agent/loop_message.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/routing-system.zh.md:22 — docs/architecture/routing-system.zh.md names `pkg/agent/loop_turn.go`, but no file or folder `pkg/agent/loop_turn.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/routing-system.zh.md:195 — docs/architecture/routing-system.zh.md names `pkg/routing.Router`, but no file or folder `pkg/routing.Router` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/runtime-events.md:5 — docs/architecture/runtime-events.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/runtime-events.zh.md:5 — docs/architecture/runtime-events.zh.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.md:29 — docs/architecture/session-system.md names `pkg/memory.Store`, but no file or folder `pkg/memory.Store` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.md:157 — docs/architecture/session-system.md names `pkg/memory.JSONLStore`, but no file or folder `pkg/memory.JSONLStore` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.zh.md:29 — docs/architecture/session-system.zh.md names `pkg/memory.Store`, but no file or folder `pkg/memory.Store` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.zh.md:32 — docs/architecture/session-system.zh.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.zh.md:32 — docs/architecture/session-system.zh.md names `pkg/agent/loop_message.go`, but no file or folder `pkg/agent/loop_message.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/architecture/session-system.zh.md:158 — docs/architecture/session-system.zh.md names `pkg/memory.JSONLStore`, but no file or folder `pkg/memory.JSONLStore` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:4 — docs/design/hook-system-design.zh.md names `pkg/events.Event`, but no file or folder `pkg/events.Event` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:62 — docs/design/hook-system-design.zh.md names `pkg/agent/loop.go`, but no file or folder `pkg/agent/loop.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:64 — docs/design/hook-system-design.zh.md names `pkg/agent/turn.go`, but no file or folder `pkg/agent/turn.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:83 — docs/design/hook-system-design.zh.md names `pkg/events.Kind`, but no file or folder `pkg/events.Kind` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:335 — docs/design/hook-system-design.zh.md names `pkg/agent/eventbus.go`, but no file or folder `pkg/agent/eventbus.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:350 — docs/design/hook-system-design.zh.md names `pkg/agent/hook_ipc.go`, but no file or folder `pkg/agent/hook_ipc.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:353 — docs/design/hook-system-design.zh.md names `pkg/agent/hook_types.go`, but no file or folder `pkg/agent/hook_types.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/design/hook-system-design.zh.md:361 — docs/design/hook-system-design.zh.md names `pkg/tools/base.go`, but no file or folder `pkg/tools/base.go` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/guides/chat-apps.fr.md:161 — docs/guides/chat-apps.fr.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/guides/chat-apps.ja.md:158 — docs/guides/chat-apps.ja.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/guides/chat-apps.ms.md:161 — docs/guides/chat-apps.ms.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/guides/chat-apps.pt-br.md:161 — docs/guides/chat-apps.pt-br.md names `workspace/whatsapp/`, but no file or folder `workspace/whatsapp` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate pkg/evolution/drafts.go:311 — `!(r >= 'a' && r <= 'z') && !(r >= '0' && r <= '9')` appears character-identically in 2 files — pkg/evolution/drafts.go, pkg/evolution/skills_recall.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 pkg/agent/pipeline_streaming.go:365 — `!field.IsValid() || !field.CanInterface()` appears character-identically in 2 files — pkg/agent/pipeline_streaming.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 web/backend/api/wecom.go:421 — `!flow.ExpiresAt.IsZero() && now.After(flow.ExpiresAt)` appears character-identically in 2 files — web/backend/api/wecom.go, web/backend/api/weixin.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 pkg/agent/pipeline_execute.go:835 — `!ts.opts.NoHistory && ts.opts.EnableSummary` appears character-identically in 2 files — pkg/agent/pipeline_execute.go, pkg/agent/pipeline_finalize.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 pkg/tools/integration/helpers.go:60 — `(r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '+' || r == '/' || r == '='` appears character-identically in 2 files — pkg/tools/integration/helpers.go, pkg/tools/normalization.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 pkg/tools/identifier_compat.go:14 — `(r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-'` appears character-identically in 2 files — pkg/tools/identifier_compat.go, pkg/tools/integration/mcp_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 pkg/agent/agent_command.go:80 — `agent == nil || agent.ContextBuilder == nil` appears character-identically in 2 files — pkg/agent/agent_command.go, pkg/agent/agent_utils.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 pkg/providers/anthropic/provider.go:196 — `args == nil && tc.Function != nil && tc.Function.Arguments != ""` appears character-identically in 2 files — pkg/providers/anthropic/provider.go, pkg/providers/bedrock/provider_bedrock.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 pkg/providers/factory_provider.go:111 — `authMethod == "oauth" || authMethod == "token"` appears character-identically in 2 files — pkg/providers/factory_provider.go, web/backend/api/model_status.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:517 — `c == nil || c.config == nil || !c.config.Streaming.Enabled` appears character-identically in 2 files — REDACTED, pkg/channels/wecom/wecom.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:91 — `c.config.AppID == "" || c.config.AppSecret.String() == ""` appears character-identically in 2 files — REDACTED, pkg/channels/qq/qq.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 pkg/agent/instance.go:563 — `candidate.ConfigKey == "" && candidate.ConfigIndex == 0` appears character-identically in 2 files — pkg/agent/instance.go, pkg/agent/pipeline_llm.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 cmd/picoclaw/internal/auth/helpers.go:445 — `cred.NeedsRefresh() && cred.RefreshToken != ""` appears character-identically in 2 files — cmd/picoclaw/internal/auth/helpers.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 pkg/memory/jsonl.go:313 — `entry.IsDir() || !strings.HasSuffix(entry.Name(), ".meta.json")` appears character-identically in 2 files — pkg/memory/jsonl.go, web/backend/api/session.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1506 — `err != nil && !errors.Is(err, os.ErrNotExist)` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:269 — `filepath.Ext(filename) == "" && ext != ""` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/backend/api/gateway.go:960 — `gateway.cmd == nil || gateway.cmd.Process == nil` appears character-identically in 2 files — web/backend/api/gateway.go, web/backend/api/version.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 pkg/tools/integration/helpers.go:29 — `inlineMarkdownDataURLRe.MatchString(trimmed) || inlineRawDataURLRe.MatchString(trimmed)` appears character-identically in 2 files — pkg/tools/integration/helpers.go, pkg/tools/normalization.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:239 — `ip == nil || ip.IsLoopback() || ip.To4() != nil` appears character-identically in 2 files — REDACTED, web/backend/utils/runtime.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 pkg/agent/model_resolution.go:166 — `left == nil || right == nil || left.IsVirtual()` appears character-identically in 2 files — pkg/agent/model_resolution.go, web/backend/api/gateway.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 pkg/agent/model_resolution.go:171 — `left.ModelName == right.ModelName && providers.ModelKey(leftProvider, leftModel) == providers.ModelKey(rightProvider, rightModel) && left.AP…` appears character-identically in 2 files — pkg/agent/model_resolution.go, web/backend/api/gateway.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 pkg/devices/service.go:150 — `len(parts) != 2 || parts[0] == "" || parts[1] == ""` appears character-identically in 2 files — pkg/devices/service.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 pkg/mcp/manager.go:84 — `line == "" || strings.HasPrefix(line, "#")` appears character-identically in 2 files — pkg/mcp/manager.go, web/backend/api/skills.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 pkg/agent/pipeline_llm.go:520 — `llmResp != nil && llmResp.Response != nil` appears character-identically in 2 files — pkg/agent/pipeline_llm.go, pkg/agent/turn_coord.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 pkg/agent/context_legacy.go:197 — `msg.Role != "user" && msg.Role != "assistant"` appears character-identically in 2 files — pkg/agent/context_legacy.go, web/backend/api/session.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D29 · Static Analysis (SAST) · REDACTED · ×23
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on error · ×16
  • Silent fallback default on error cmd/picoclaw/internal/mcp/show.go:131 — `normalizeSchema` turns a non-nil `err` into `return map[string]any{}` — 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 pkg/agent/discovery.go:248 — `formatAgentDiscoverySection` 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 pkg/agent/model_resolution.go:72 — `modelConfigResolutionKey` 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 REDACTED:611 — `extractAccountID` 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 pkg/channels/onebot/onebot.go:743 — `parseMessageSegments` turns a non-nil `err` into `return parseMessageResult{}` — 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 pkg/credential/credential.go:336 — `findDefaultSSHKey` 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 pkg/evolution/drafts.go:320 — `validSkillNameOrEmpty` 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 pkg/evolution/skill_content.go:48 — `readSkillBodyExcerpt` 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 pkg/gateway/gateway.go:822 — `getFileModTime` turns a non-nil `err` into `return time.Time{}` — 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 pkg/gateway/gateway.go:830 — `getFileSize` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error pkg/providers/openai_compat/provider.go:320 — `normalizedHostname` 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 pkg/skills/github_registry.go:87 — `SkillURL` 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 pkg/tools/integration/web.go:119 — `extractSogouURL` 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 REDACTED:397 — `buildReleaseAPIURL` 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 web/backend/api/skills.go:1104 — `builtinSkillsDir` 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 web/backend/api/tools.go:722 — `resolveCurrentWebSearchProvider` 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.
D16 · Bus Factor · Off-boarding risk · ×6
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 9 significant file(s) lose their only recent owner: pkg/agent/runtime_event_logger.go, pkg/channels/split.go, pkg/config/legacy_bindings.go, pkg/session/key.go, pkg/session/allocator.go, pkg/channels/wecom/protocol.go, pkg/channels/qq/audio_duration.go, pkg/agent/dispatch_request.go (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: pkg/providers/common/google_schema.go, cmd/picoclaw/internal/mcp/helpers.go, cmd/picoclaw/internal/mcp/add.go, pkg/agent/discovery.go, pkg/agent/tool_allowlist.go, pkg/tools/shared/diff_result.go, pkg/agent/agent_stop.go. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/routing/features.go, pkg/routing/classifier.go, pkg/tools/delegate.go, pkg/routing/router.go. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/tools/hardware/serial.go, web/frontend/src/components/models/test-model-dialog.tsx, pkg/tools/hardware/serial_unix.go, REDACTED. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/netbind/netbind.go, web/frontend/src/features/chat/tool-calls.ts, web/frontend/src/features/chat/assistant-message-state.ts, pkg/tools/fs_facade.go. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: web/frontend/src/components/channels/channel-forms/wecom-form.tsx, web/frontend/src/components/agent/tools/tool-library-tab.tsx, web/frontend/src/components/channels/channel-forms/discord-form.tsx, web/frontend/src/components/channels/channel-forms/slack-form.tsx, web/frontend/src/hooks/use-gateway-logs.ts. Pair on, review, or document these before any departure.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×4
  • Hand-rolled JSON/XML parsing via regex pkg/tools/integration/web.go:52 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex pkg/tools/integration/web.go:55 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex pkg/tools/integration/web.go:58 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex pkg/tools/integration/web.go:60 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
X9 · Subsumed condition operand · Subsumed condition operand · ×4
  • Subsumed condition operand pkg/agent/llm_media.go:49 — `strings.Contains(msg, "does not support image inputs")` can never decide this `||` — every value satisfying `strings.Contains(msg, "does not support image inputs")` also satisfies `strings.Contains(msg, "does not support image input")`, 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 REDACTED:345 — `strings.Contains(n, "sha256sum")` can never decide this `||` — every value satisfying `strings.Contains(n, "sha256sum")` also satisfies `strings.Contains(n, "sha256")`, 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 REDACTED:347 — `strings.HasSuffix(n, ".sha256")` can never decide this `||` — every value satisfying `strings.HasSuffix(n, ".sha256")` also satisfies `strings.Contains(n, "sha256")`, 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 REDACTED:348 — `strings.HasSuffix(n, ".sha256sum")` can never decide this `||` — every value satisfying `strings.HasSuffix(n, ".sha256sum")` also satisfies `strings.Contains(n, "sha256")`, 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 8 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (47 single-owned of 414 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 414 of the 691 production source files in this repository met that bar). They are anonymized user #7 (4 file(s)), anonymized user #8 (3 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: web/frontend/src/components/chat/message-code-block.tsx, pkg/utils/http_guard.go, web/frontend/src/components/chat/message-code-block.utils.ts, web/backend/middleware/access_control.go, pkg/channels/weixin/types.go, pkg/channels/weixin/api.go, pkg/channels/weixin/auth.go, REDACTED (+6 more).
D20 · ADR Quality · ADR has no Decision and Consequences section · ×1
  • ADR has no Decision and Consequences section docs/design/steering-spec.md:1 — docs/design/steering-spec.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (118650 LoC, 836 module-visible types across 108 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 62 of 414 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 414 of the 691 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: cmd/membench/eval_llm.go, pkg/skills/registry.go, pkg/audio/asr/whisper_transcriber.go, cmd/picoclaw/internal/cliui/help_cmd.go, cmd/membench/metrics.go, web/backend/api/wecom.go, web/frontend/src/hooks/use-credentials-page.ts, pkg/audio/asr/agent.go (and 54 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `docs/design/steering-spec.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
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 33/52 functions that make a cancellable request (fetch, axios, ky, ofetch; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~0.2 `!` null assertions per 1k TypeScript source lines — 4 assertion(s) across the 24537 source line(s) of the 151 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/frontend/src/components/agent/skills/use-skills-page.ts (1), web/frontend/src/components/models/add-model-sheet.tsx (1), web/frontend/src/components/models/edit-model-sheet.tsx (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Minor — 28 finding(s)
D12 · Dependency Hygiene · Outdated · ×28
  • Outdated: github.com/Azure/azure-sdk-for-go/sdk/azcore — `github.com/Azure/azure-sdk-for-go/sdk/azcore` is required at v1.22.0 in REDACTED, but v1.23.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/Azure/azure-sdk-for-go/sdk/azcore@v1.23.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/Azure/azure-sdk-for-go/sdk/azidentity — `github.com/Azure/azure-sdk-for-go/sdk/azidentity` is required at v1.14.0 in REDACTED, but v1.15.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/Azure/azure-sdk-for-go/sdk/azidentity@v1.15.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/adhocore/gronx — `github.com/adhocore/gronx` is required at v1.20.0 in REDACTED, but v1.20.5 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/adhocore/gronx@v1.20.5 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/anthropics/anthropic-sdk-go — `github.com/anthropics/anthropic-sdk-go` is required at v1.55.1 in REDACTED, but v1.84.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/anthropics/anthropic-sdk-go@v1.84.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2 — `github.com/aws/aws-sdk-go-v2` is required at v1.42.0 in REDACTED, but v1.47.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/aws/aws-sdk-go-v2@v1.47.4 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/config — `github.com/aws/aws-sdk-go-v2/config` is required at v1.32.25 in REDACTED, but v1.33.10 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/config@v1.33.10 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/bedrockruntime — `github.com/aws/aws-sdk-go-v2/service/bedrockruntime` is required at v1.53.3 in REDACTED, but v1.63.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/aws/aws-sdk-go-v2/service/bedrockruntime@v1.63.7 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/ergochat/irc-go — `github.com/ergochat/irc-go` is required at v0.6.0 in REDACTED, but v0.7.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/ergochat/irc-go@v0.7.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/github/copilot-sdk/go — `github.com/github/copilot-sdk/go` is required at v0.2.0 in REDACTED, but v1.0.26 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/github/copilot-sdk/go@v1.0.26 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/larksuite/oapi-sdk-go/v3 — `github.com/larksuite/oapi-sdk-go/v3` is required at v3.9.4 in REDACTED, but v3.12.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/larksuite/oapi-sdk-go/v3@v3.12.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/line/line-bot-sdk-go/v8 — `github.com/line/line-bot-sdk-go/v8` is required at v8.20.1 in REDACTED, but v8.23.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/line/line-bot-sdk-go/v8@v8.23.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/modelcontextprotocol/go-sdk — `github.com/modelcontextprotocol/go-sdk` is required at v1.6.1 in REDACTED, but v1.8.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/modelcontextprotocol/go-sdk@v1.8.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/mymmrac/telego — `github.com/mymmrac/telego` is required at v1.10.0 in REDACTED, but v1.12.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/mymmrac/telego@v1.12.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/openai/openai-go/v3 — `github.com/openai/openai-go/v3` is required at v3.22.0 in REDACTED, but v3.86.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/openai/openai-go/v3@v3.86.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/pion/rtp — `github.com/pion/rtp` is required at v1.10.2 in REDACTED, but v1.10.6 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pion/rtp@v1.10.6 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/slack-go/slack — `github.com/slack-go/slack` is required at v0.23.1 in REDACTED, but v0.30.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/slack-go/slack@v0.30.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/stretchr/testify — `github.com/stretchr/testify` is required at v1.11.1 in REDACTED, but v1.12.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/stretchr/testify@v1.12.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.mau.fi/util — `go.mau.fi/util` is required at v0.9.8 in REDACTED, but v0.11.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.mau.fi/util@v0.11.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.53.0 in REDACTED, but v0.58.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.58.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/net — `golang.org/x/net` is required at v0.55.0 in REDACTED, but v0.61.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/net@v0.61.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.36.0 in REDACTED, but v0.37.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.37.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.21.0 in REDACTED, but v0.24.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.24.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.46.0 in REDACTED, but v0.49.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.49.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/term — `golang.org/x/term` is required at v0.44.0 in REDACTED, but v0.47.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/term@v0.47.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: golang.org/x/time — `golang.org/x/time` is required at v0.15.0 in REDACTED, but v0.16.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/time@v0.16.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • + 3 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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-80a7a5a1bcb94f8e9a79aad5e3156ed1/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-80a7a5a1bcb94f8e9a79aad5e3156ed1/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/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .127artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update6artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .22artifacts/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 2 file(s) — `web/frontend/src/components/agent/skills/detail-sheet.tsx`, `web/frontend/src/features/chat/history.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/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a16baa-89e7-702f-bf82-ad274f7391c6 · 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