Public report of phodal/auto-dev, 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, 22:02 UTC · Survey ID cd_dd26a76e2d454224885fd17c2740ca2e

phodal/auto-dev

Measured 24 October 2026, 21:50 UTC, at code version e8b99f9

No regression since the last survey Code coverage: not measured

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.

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

CAI score 46out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 1 since the last survey

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

A large codebase: 305,170 lines of product code in 16 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Accessibility, 39

Findings by how serious they are

166 critical 1698 serious 807 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, 21:50 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds 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 ▸

81of 85 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
2647of 2671 findings point to an exact file and line, so you can open each one in the code. The other 24 concern the repository as a whole, such as missing documentation.
85dimensions across 7 lenses, read from 305,170 lines of product code in 16 projects.
Chapters

Executive summary

phodal/auto-dev scores 46 out of 100 and is rated Weak, while five of its seven lenses score higher still: Architecture at 88, Performance at 60, Code Health at 58 and Production Readiness at 53, all rated Adequate, and Maturity at 73, rated Strong.

The score is lower than those five because the weakest lens counts most, and here that is Accessibility, which scores 39 and is rated Weak. Its Keyboard semantics dimension scores 2.3 out of 10, and until that reaches 4, Accessibility can't be rated higher than Adequate. The first actions are to encrypt sensitive data at rest (open the store encrypted — SQLCipher's SupportFactory for Room, a Realm encryptionKey — or encrypt the fields with Tink's AEAD or an AES/GCM Cipher, or use Jetpack Security's EncryptedSharedPreferences on Android) keeping its key in the Android Keystore or a vault, and manage server-side keys in a vault (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault) 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 46 to about 51.

166 findings are critical: 87 in Static Analysis (SAST), 37 in Forms & labels, 11 in Keyboard semantics, nine in Async correctness, nine in Knowledge Freshness, eight in Change Coupling, two in Dependency Hygiene, two in Page structure and one in Circular Imports.

Watchdog couldn't measure 11 dimensions in this code, among them Test Distribution, Test Reliability and Dependency Hygiene, so they are left out of the score. The product code is 305,170 lines, which would take an estimated 2.2 person-years, around €320,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 39 · counts for 46%Security and Compliance 43 · counts for 25%Production Readiness 53 · counts for 14%Code Health 58 · counts for 8%Performance 60 · counts for 4%Maturity 73 · counts for 2%Architecture 88 · counts for 1%

If Accessibility rose from 39 to 70, the lowest score rated Strong, the score would rise from 46 to about 51.

Code composition: what the lines of code are
Product code 85%Tests 15%
New since the last survey: 85 findings

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

  • Knowledge Freshness · Orphaned knowledge mpp-vscode/src/providers/code-element-parser.ts
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.wasmJs.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.wasmJs.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/nano/ComposeActionHandler.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CosTestCli.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.wasmJs.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.wasmJs.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/iosMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/iosMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.ios.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.js.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.jvm.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.jvm.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.wasmJs.kt
  • Outbound HTTP resilience · Outbound HTTP without resilience xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.wasmJs.kt
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-viewer-web/src/commonMain/resources/mermaid.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-web/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-web/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-web/index.html
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-web/index.html
  • Visual & motion safety · Focus outline removed in CSS without a :focus replacement mpp-vscode/webview/src/components/DevInInput.css
  • Visual & motion safety · Focus outline removed in CSS without a :focus replacement mpp-vscode/webview/src/components/Omnibar.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-web/src/index.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/App.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/App.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/MessageList.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/MessageList.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/ModelSelector.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/Timeline.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/SketchRenderer.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/TerminalRenderer.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/ThinkingRenderer.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css
  • Async & latency hygiene · Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs
  • Async & latency hygiene · Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs
  • Async & latency hygiene · Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/CodexMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/CodexMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts
  • Async & latency hygiene · Sync-over-async blocking mpp-vscode/src/services/config-manager.ts

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: 254 findings

These 254 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.

  • License Compliance · Banned license: com.mysql:mysql-connector-j
  • Supply-chain Provenance & Signing REDACTED
  • Supply-chain Provenance & Signing REDACTED
  • Code Duplication · Duplicated block (11 lines × 3 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts
  • Code Duplication · Duplicated block (11 lines × 2 locations) mpp-web/src/LandingPage.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) mpp-ui/src/jsMain/typescript/index.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts
  • Code Duplication · Duplicated block (10 lines × 3 locations) mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx
  • Code Duplication · Duplicated block (10 lines × 2 locations) mpp-ui/src/jsMain/typescript/ui/WelcomeScreen.tsx
  • Code Duplication · Duplicated block (10 lines × 3 locations) mpp-vscode/src/commands/codelens-commands.ts
  • Code Duplication · Duplicated block (10 lines × 2 locations) mpp-vscode/src/providers/code-element-parser.ts
  • Code Duplication · Duplicated block (10 lines × 3 locations) mpp-vscode/webview/src/components/FileChip.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts
  • Code Duplication · Duplicated block with local edits (9 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-vscode/webview/src/components/MessageList.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx
  • Code Duplication · Duplicated block (9 lines × 2 locations) mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.tsx
  • Code Duplication · Duplicated block (8 lines × 2 locations) mpp-ui/src/jsMain/typescript/ui/App.tsx
  • Code Duplication · Duplicated block (8 lines × 2 locations) mpp-ui/src/jsMain/typescript/ui/MessageRenderer.tsx
  • Code Duplication · Duplicated block (8 lines × 2 locations) mpp-ui/src/jsMain/typescript/utils/commandUtils.ts
  • Code Duplication · Duplicated block (7 lines × 4 locations) mpp-ui/scripts/check-mpp-core.js
  • Code Duplication · Duplicated block (7 lines × 2 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts
  • Code Duplication · Duplicated block (7 lines × 2 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts
  • Code Duplication · Duplicated block (7 lines × 2 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts
  • Code Duplication · Duplicated block (7 lines × 6 locations) mpp-ui/src/jsMain/typescript/processors/AtCommandProcessor.ts
  • Code Duplication · Duplicated block with local edits (7 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts
  • Code Duplication · Duplicated block (7 lines × 2 locations) mpp-vscode/src/providers/chat-view.ts
  • Code Duplication · Duplicated block (7 lines × 2 locations) mpp-vscode/src/services/ide-server.ts
  • Code Duplication · Duplicated block (7 lines × 4 locations) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx
  • Code Duplication · Duplicated block with local edits (6 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts
  • Code Duplication · Duplicated block (6 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/devins/filesystem/ProjectFileSystem.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/devins/filesystem/ProjectFileSystem.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/devins/filesystem/ProjectFileSystem.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/kotlin/cc/unitmesh/devins/filesystem/ProjectFileSystem.ios.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/iosMain/swift/McpClientBridge.swift
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/Platform.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/llm/SessionStorage.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/llm/SessionStorage.js.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClientSessionOps.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClientSessionOps.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClientSessionOps.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpAgentSession.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpAgentServer.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpAgentProcessManager.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeProtocol.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeProtocol.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeProtocol.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeProtocol.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/SqlValidator.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Exception handling · Swallowed exception (empty catch) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/ShellEnvironmentUtils.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/llm/ExecutorFactory.jvm.kt
  • Exception handling · Swallowed exception (caught, then discarded) mpp-core/src/jvmMain/kotlin/cc/unitmesh/llm/multimodal/ImageCompressor.kt
Rebuild cost: about €320,000 · Estimate
Cost to rebuild€110,000 to €530,000, for 1,770 to 5,614 hours of work, about 2.2 person-years for 1 to 5 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 46. 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: 305,170 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
Encrypt sensitive data at rest (open the store encrypted — SQLCipher's SupportFactory for Room, a Realm encryptionKey — or encrypt the fields with Tink's AEAD or an AES/GCM Cipher, or use Jetpack Security's EncryptedSharedPreferences on Android) keeping its key in the Android Keystore or a vault, and manage server-side keys in a vault (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault).
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 4 points · Medium effort · Data Protection
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 3 points · Medium effort · Keyboard semantics
3
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 2 points · Medium effort · Text alternatives

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 €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Accessibility, at 39 (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
Encrypt sensitive data at rest (open the store encrypted — SQLCipher's SupportFactory for Room, a Realm encryptionKey — or encrypt the fields with Tink's AEAD or an AES/GCM Cipher, or use Jetpack Security's EncryptedSharedPreferences on Android) keeping its key in the Android Keystore or a vault, and manage server-side keys in a vault (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault). Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch @autodev/web web @xiuper/cli cli AutoDevApp AutoDevApp Xiuper Xiuper Xiuper:mpp-codegraph Xiuper:mpp-codegraph Xiuper:mpp-core Xiuper:mpp-core Xiuper:mpp-core->Xiuper:mpp-codegraph Xiuper:mpp-server Xiuper:mpp-server Xiuper:mpp-server->Xiuper:mpp-core Xiuper:mpp-ui Xiuper:mpp-ui Xiuper:mpp-ui->Xiuper:mpp-codegraph Xiuper:mpp-ui->Xiuper:mpp-core Xiuper:mpp-viewer Xiuper:mpp-viewer Xiuper:mpp-ui->Xiuper:mpp-viewer Xiuper:mpp-viewer-web Xiuper:mpp-viewer-web Xiuper:mpp-ui->Xiuper:mpp-viewer-web Xiuper:xiuper-e2e Xiuper:xiuper-e2e Xiuper:mpp-ui->Xiuper:xiuper-e2e Xiuper:xiuper-ui Xiuper:xiuper-ui Xiuper:mpp-ui->Xiuper:xiuper-ui Xiuper:mpp-viewer-web->Xiuper:mpp-core Xiuper:mpp-viewer-web->Xiuper:mpp-viewer Xiuper:xiuper-e2e->Xiuper:mpp-core Xiuper:xiuper-fs Xiuper:xiuper-fs Xiuper:xiuper-ui->Xiuper:mpp-core autodev autodev autodev-webview autodev-webview mpp-idea mpp-idea

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.

1591 modules, with 2044 dependencies between them. 29 loops run through 112 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 agent.artifact2 agent.config3 agent.database4 agent.plan5 agent.tool6 agent.webagent.model7 devins.document8 devins.filesystem9 devti.agent.tool10 devti.context11 devti.devins.provider12 devti.language.ast13 devti.template.context14 xiuper.fs15 xuiper.ir16 devti.command.dataprovider17 devti.gui.chat.message18 llm19 xuiper.props20 agent.linter21 agent.tool.impl.docql22 devti.command23 devti.llms.custom24 devti.provider.context25 agent.tool.impl26 devti.provider27 devti.sketch28 agent.subagent29 devti.bridge30 devti.custom.document31 devti.language.startup32 agent.render33 agent.orchestrator34 agent.executor35 agent.chatdb36 agent.document37 agent38 config39 devins.ui.compose.agent40 devins.ui.compose.agent.codereview
1 agent.artifact
2 agent.config
3 agent.database
4 agent.plan
5 agent.tool
6 agent.webagent.model
7 devins.document
8 devins.filesystem
9 devti.agent.tool
10 devti.context
11 devti.devins.provider
12 devti.language.ast
13 devti.template.context
14 xiuper.fs
15 xuiper.ir
16 devti.command.dataprovider1
17 devti.gui.chat.message1
18 llm29
19 xuiper.props14
20 agent.linter3
21 agent.tool.impl.docql621
22 devti.command1
23 devti.llms.custom1
24 devti.provider.context11
25 agent.tool.impl31131652
26 devti.provider121121
27 devti.sketch11111
28 agent.subagent61153
29 devti.bridge1112
30 devti.custom.document1
31 devti.language.startup161
32 agent.render2122
33 agent.orchestrator11521
34 agent.executor414717
35 agent.chatdb12044221
36 agent.document111111
37 agent9121118685222
38 config141
39 devins.ui.compose.agent12243612136
40 devins.ui.compose.agent.codereview13223
Uses a module listed above itPart of a loopThe module itself
1 agent.artifact2 agent.config3 agent.database4 agent.plan5 agent.tool6 agent.webagent.model7 devins.document8 devins.filesystem9 devti.agent.tool10 devti.context11 devti.devins.provider12 devti.language.ast13 devti.template.context14 xiuper.fs15 xuiper.ir16 devti.command.dataprovider17 devti.gui.chat.message18 llm19 xuiper.props20 agent.linter21 agent.tool.impl.docql22 devti.command23 devti.llms.custom24 devti.provider.context25 agent.tool.impl26 devti.provider27 devti.sketch28 agent.subagent29 devti.bridge30 devti.custom.document31 devti.language.startup32 agent.render33 agent.orchestrator34 agent.executor35 agent.chatdb36 agent.document37 agent38 config39 devins.ui.compose.agent40 devins.ui.compose.agent.codereviewagent.artifact1agent.config2agent.database3agent.plan4agent.tool5agent.webagent.model6devins.document7devins.filesystem8devti.agent.tool9devti.context10devti.devins.provider11devti.language.ast12devti.template.context13xiuper.fs14xuiper.ir15devti.command.dataprovider16devti.gui.chat.message17llm18xuiper.props19agent.linter20agent.tool.impl.docql21devti.command22devti.llms.custom23devti.provider.context24agent.tool.impl25devti.provider26devti.sketch27agent.subagent28devti.bridge29devti.custom.document30devti.language.startup31agent.render32agent.orchestrator33agent.executor34agent.chatdb35agent.document36agent37config38devins.ui.compose.agent39devins.ui.compose.agent.codereview4011291436211111311316521211211111161153111211612122115214147171204422111111191211186852221411224361213613223+1551 more modules (most-connected shown)

At a glance — Code Health · 58% · Adequate ·

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

At a glance — Maturity · 73% · Strong ·

At a glance — Readiness · 53% · Adequate · gated by R4, R8, P7 ·

At a glance — Security · 43% · Weak · gated by D29, D36, C1 ·

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

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection92High / Critical
A03:2025 — Software Supply Chain Failures9Medium
A02:2025 — Security Misconfiguration2Medium

Roadmap

First, secure sensitive data by encrypting it at rest and managing keys in a dedicated vault, while enforcing HTTPS. Next, improve accessibility by making custom controls keyboard-operable, adding text alternatives for media, and ensuring all form controls have programmatic labels. Finally, integrate accessibility checks into the development toolchain and CI pipeline to enforce these standards automatically.

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

Do thisHelpsEffortDimension
Encrypt sensitive data at rest (open the store encrypted — SQLCipher's SupportFactory for Room, a Realm encryptionKey — or encrypt the fields with Tink's AEAD or an AES/GCM Cipher, or use Jetpack Security's EncryptedSharedPreferences on Android) keeping its key in the Android Keystore or a vault, and manage server-side keys in a vault (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault). Skip if delegated to infra (Postgres TDE, KMS, etc.).+4.0 ptsMediumData Protection
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+3.2 ptsMediumKeyboard semantics
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+2.4 ptsMediumText alternatives
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+2.1 ptsMediumA11y enforcement
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.9 ptsMediumForms & labels
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+1.8 ptsMediumVisual & motion safety
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+0.8 ptsLowSupply-chain Provenance & Signing
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+1.4 ptsMediumPage structure

File quality

Per-file score 0–10 — a quality signature. Of 549 files carrying findings, judged against the Production bar: 1% slop · 54% mixed · 45% near-clean.

FileScoreBandWorst signal
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt2.3SlopChange Coupling: Boundary-crossing change coupling: WebEditPage.kt ↔ WebEditView.jvm.kt
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt5.5MixedCyclomatic Complexity: ArtifactCli.main (cyclomatic 31)
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt5.6MixedCyclomatic Complexity: ToolOrchestrator.executeToolCall (cyclomatic 18)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt5.6MixedGod Classes: ClassTooLong: CodeReviewViewModel
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt5.7MixedCode Duplication: Duplicated block (28 lines × 2)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt5.9MixedCyclomatic Complexity: IdeaAgentAppKt.IdeaAgentApp (cyclomatic 53)
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt5.9MixedCyclomatic Complexity: DocumentCli.main (cyclomatic 50)
mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts6.0MixedExplicit Debt: TodoComment
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaSketchRenderer.kt6.0MixedExplicit Debt: TodoComment
mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt6.0MixedExplicit Debt: TodoComment
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditChatInput.kt6.0MixedExplicit Debt: TodoComment
mpp-ui/src/jsMain/typescript/index.tsx6.0MixedExplicit Debt: TodoComment
mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt6.0MixedExplicit Debt: TodoComment
mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/SelfHealingLocator.kt6.0MixedExplicit Debt: TodoComment

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

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

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

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. 81 of 85 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 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
D1D2D3D4D5D6D10D13D15D17D19D20D21D22D26D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX2AX3AX4AX6AX9C1M1M2M3M4P1P10P2P3P4P6P7PF2PF3R1R10R2R3R4R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X20X21X22X23X24X25X26X27X28X29X3X30X4X5

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, 2647 of 2671 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 01a16fe5-1521-7445-b8b0-49a478f31c50.

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.

  • D9 Test Distribution — 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. Test distribution NOT SCORED: this repository's production source spans more than one ecosystem, and the test-pyramid census cannot read the .kt test suite(s) — so the pyramid was not measured for the repository as a whole. The suites we could count came back with 280 test method(s) (280 unit, 0 integration, 0 BDD, 0 e2e), but that is a shape for one part of the product and we do not publish a partial pyramid as if it were complete. This is OUR limitation, not a defect in the repo — test distribution is excluded from the score rather than counted.
  • D10 Test Quality — 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. The 280 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 327 test source file(s) (.kt) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — 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. Test reliability NOT SCORED: this repository's production source includes .kt, and the jvm executor ran against the .kt half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm install --ignore-scripts` (no lockfile) in mpp-ui/ (138 tests); vitest via `npm install --ignore-scripts` (no lockfile) in mpp-vscode/ (63 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D12 Dependency Hygiene — 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. Not scored — 12 Maven/Gradle manifest(s) were read, stating a version for 163 dependency(ies) and leaving 7 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (30 contributor(s) across 7723 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 29 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • 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. `mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/schema/ToolSchema.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt`, `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/filesystem/WasmJsToolFileSystem.kt`, … (+28 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/DependencyGraph.kt, 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 REDACTED (REDACTED). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; runtime evidence skipped.
  • 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.
  • 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 Kotlin, Python, Swift, c 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 Kotlin, Python, Swift, c 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.
  • P2 Observability — 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. 295 further occurrence(s) are not listed individually; the score already reflects all 335.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • P8 Schema migrations — 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. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
  • 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. 31 further occurrence(s) are not listed individually; the score already reflects all 71.
  • 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. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
  • 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. 207 further occurrence(s) are not listed individually; the score already reflects all 247.
  • X4 Structured logging — 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. 97 further occurrence(s) are not listed individually; the score already reflects all 137.

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

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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality 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.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • 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 (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: 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".
  • 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 (4): D19, D21, D22, 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 Complexity5.9 / 10Adequate✓ 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 5.9 / 10 · rule-coverage 100% · ceiling Prevented

189 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DevInEditorInputKt.DevInEditorInput at 108. A further 44 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 ContentComponents.mapIconName at 136 — they are counted neither in the figure above nor in this dimension's score. 28 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/content/ContentComponents.kt (ContentComponents.mapIconName at 136), mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt (CodeFence.lookupFileExt at 45), xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt (NanoIRConverter.convert at 35), mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/language/LanguageDetector.kt (LanguageDetector.detectLanguage at 34), xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/HtmlRenderer.kt (HtmlRenderer.renderNode at 33), and 23 more not listed here. 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.

jvmKt.WebEditView (cyclomatic 41) · ×2mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21
NanoDSLValidator.performBasicValidation (cyclomatic 21) · ×2mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:35
GitOperations.getCommitDiff (cyclomatic 16) · ×2mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/platform/GitOperations.kt:48
DevInEditorInputKt.DevInEditorInput (cyclomatic 108)mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt:79
NanoExpressionEvaluator.evaluateCondition (cyclomatic 85)xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:680

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

What to do

  1. Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with DevInEditorInputKt.DevInEditorInput (cyclomatic 108), NanoExpressionEvaluator.evaluateCondition (cyclomatic 85), ToolCallItemKt.ToolItem (cyclomatic 75). — 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 6 together lifts Cyclomatic Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity5.5 / 10Adequate✓ 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 5.5 / 10 · rule-coverage 100% · ceiling Prevented

298 method(s) exceeded the cognitive complexity threshold of 15; the worst was DevInEditorInputKt.DevInEditorInput at 155.

jvmKt.WebEditView (cognitive 62) · ×2mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21
NanoDSLValidator.performBasicValidation (cognitive 29) · ×2mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:35
WebEditVisionHelperKt.createWebEditVisionHelper (cognitive 23) · ×2mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditVisionHelper.kt:50
DiffFormatter.postProcess (cognitive 23) · ×2mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:19
CodeFence.parseMarkdownContent (cognitive 19) · ×2mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:150

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with DevInEditorInputKt.DevInEditorInput (cognitive 155), DocQLResultFormatter.formatDocQLResult (cognitive 125), ToolCallItemKt.ToolItem (cognitive 124). — 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 3 together lifts Cognitive Complexity from 5.5 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.1 / 10Strong✓ Tool-verified

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

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

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

148 god class(es) detected.

MethodTooLong: ChatDBStepCardKt.StepDetails · ×79mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:168
FileTooLong: toolwindow/IdeaComposeIcons.kt · ×30mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt
FunctionTooLong: App.WebUiApp · ×14mpp-web/src/App.tsx:7
ClassTooLong: ComposeRenderer · ×13mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:40
TooManyMethods: NodeReplRuntime · ×12mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:68

What to do

  1. Resolve the 79 MethodTooLong finding(s) in God Classes — start with WebEditView.jvm.kt (3), ToolConfigDialog.kt (2), IdeaMcpConfigDialog.kt (2). — One of this dimension's main actionable groups (79 warning-level).
  2. Resolve the 30 FileTooLong finding(s) in God Classes — start with IdeaComposeIcons.kt, NodeReplRuntime.ts, IndentParser.kt. — One of this dimension's main actionable groups (30 warning-level).
  3. Resolve the 14 FunctionTooLong finding(s) in God Classes — start with App.tsx (3), ModelConfigForm.tsx, ChatInterface.tsx. — One of this dimension's main actionable groups (14 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.0 / 10Stronggated by 644 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.0 / 10 · rule-coverage 100% · ceiling Verified

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

Duplicated block (11 lines × 2) · ×32mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:119
Duplicated block (12 lines × 2) · ×30mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:73
Duplicated block (13 lines × 2) · ×27mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:293
Duplicated block (9 lines × 2) · ×27mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:77
Duplicated block (10 lines × 2) · ×25mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:164

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

What to do

  1. Resolve the 32 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with WorkflowController.kt (2), StructuredInfoPane.kt (2), AndroidCodeParserFactory.kt. — One of this dimension's main actionable groups (32 warning-level).
  2. Resolve the 30 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with InlayLayoutManager.kt (2), IdeaKnowledgeContent.kt (2), DefaultFileSystem.kt (2). — One of this dimension's main actionable groups (30 warning-level).
  3. Resolve the 27 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with IosCodeParser.kt, GitHubPRReviewService.kt, DevInsLexer.kt. — 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 · Coupling8.5 / 10Strong✓ 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 8.5 / 10 · rule-coverage 100% · ceiling Prevented

16 production modules (Gradle+npm+SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 3 module(s) off the main sequence, with abstractness counted on 14 of the 16 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: Xiuper:mpp-viewer · ×3

What to do

  1. Resolve the 3 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 10 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

10 of 592 classes have LCOM4 above 3.

Low cohesion: CodingCliRenderer (LCOM4 8) · ×10mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:162

What to do

  1. Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with CodingCli.kt, DocumentCli.kt, LLMModelManager.kt. — One of this dimension's main actionable groups (10 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt9.9 / 10Stronggated by 92 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 9.9 / 10 · rule-coverage 100% · ceiling Prevented

92 deducted task-comment markers across 305170 LoC (0.0/KLoC) → score 9.9. 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 · ×92mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/Platform.kt:52

What to do

  1. Resolve the 92 TodoComment finding(s) in Explicit Debt — start with PageStateExtractor.jvm.kt (8), DefaultFileSystem.wasmJs.kt (4), ArtifactPreviewPanel.ios.kt (3). — One of this dimension's main actionable groups (92 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 QualityStrong◐ 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 Strong / 10 · rule-coverage 100% · ceiling Documented

The repository is well documented: the READMEs of each directory (xiuper-fs/README.md, xiuper-ui/README.md, example/custom_agent/README.md, examples/skills/README.md) are complete and clearly describe their respective directories. The root README covers installation, usage, contribution, and license; the architecture/design docs (xiuper-fs: Agent-VFS-style Virtual File System (KMP), NanoDSL: AI Agent's UI System Architecture & DSL Specification, mpp-idea/mpp-idea-exts/README.md) are comprehensive with full outlines. The documents are well structured with headings, an overview section, and a clear architecture/design rationale for each tier. The repository contains 24 README files and four architecture/Docs markdown files. The mpp-core directory's README is a proper deployment tier documenting that directory (DevIns Kotlin Multiplatform parser), while the viewer-web automation framework README is also a proper deployment tier. Both are well written for their audiences, with clear headings, an overview paragraph, and usage examples. The ToolBasedCompletion.md document is a detailed architecture/design doc describing the new Tool-based command-completion provider, its features, supported tool types, integration example, trigger analysis, cross-platform support, and a clipped outline (major sections present). (10 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

What to do

  1. Improve Documentation Quality — currently 8.8/10. — The repository is well documented: the READMEs of each directory (xiuper-fs/README.md, xiuper-ui/README.md, example/custom_agent/README.md, examples/skills/README.md) are complete and clearly describe their respective directories. The root README covers installation, usage, contribution, and license; the architecture/design docs (xiuper-fs: Agent-VFS-style Virtual File System (KMP), NanoDSL: AI Agent's UI System Architecture & DSL Specification, mpp-idea/mpp-idea-exts/README.md) are comprehensive with full outlines. The documents are well structured with headings, an overview section, and a clear architecture/design rationale for each tier. The repository contains 24 README files and four architecture/Docs markdown files. The mpp-core directory's README is a proper deployment tier documenting that directory (DevIns Kotlin Multiplatform parser), while the viewer-web automation framework README is also a proper deployment tier. Both are well written for their audiences, with clear headings, an overview paragraph, and usage examples. The ToolBasedCompletion.md document is a detailed architecture/design doc describing the new Tool-based command-completion provider, its features, supported tool types, integration example, trigger analysis, cross-platform support, and a clipped outline (major sections present). (10 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

Detailed fixes: d19_recommendation.md.

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

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

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming 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.

D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

2 API inconsistencies across 7 exposed types.

Ambiguous global connection state vs specific server state. `isConnected` implies a single boolean state for the manager, but the manager can manage multiple servers (as seen in `MCPConfig` and `discoverServerTools`). It is unclear if `isConnected` returns true if *any* server is connected, *all* servers are connected, or if it refers to the underlying transport connection.
Redundant or overlapping state reporting. `connectionStatus` is a String (likely 'connected', 'disconnected', 'error'), while `lastError` captures error details. If `connectionStatus` can be 'error', it duplicates the presence of `lastError`. If `connectionStatus` is purely transport-level, it should be named `transportState` to distinguish from logical connection status.

What to do

  1. Resolve the 1 Ambiguous global connection state vs specific server state.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Redundant or overlapping state reporting. `connectionStatus` is a String… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion2.9 / 10Weak✓ 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 2.9 / 10 · rule-coverage 100% · ceiling Documented

5 of 14 build units (Gradle, SwiftPM, 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)1.9 / 10Critical✓ Tool-verified

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

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

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

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

92 finding(s): 0 critical, 87 high, 5 medium, 0 low. 79 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 13 file(s) — `gradlew` (line 74, line 180), `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/team/TeamPromptExecTask.kt` (line 56, line 71), `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/lint/SketchCodeInspection.kt` (line 89), `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/CodeHighlightSketch.kt` (line 90), `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorUtil.kt` (lines 126–127), … (+8 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 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

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

What to do

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

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

D30 · Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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

No known-vulnerable dependencies in any ecosystem this repository declares.

✓ On the Gold path — maintain.

Detailed fixes: d30_recommendation.md.

D31 · IaC & Container Security9.8 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

REDACTED

What to do

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

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

D34 · Knowledge Freshness5.4 / 10Adequate✓ 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 5.4 / 10 · rule-coverage 100% · ceiling Documented

608 of 1333 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt. Counted over 1333 of the 2316 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×9mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:1
Orphaned file · ×599mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:1
Further orphaned files (smaller)

What to do

  1. Resolve the 599 Orphaned file finding(s) in Knowledge Freshness — start with SessionRepository.kt (4), ClaudeSkillCommand.kt (2), DiffFormatter.kt (2). — One of this dimension's main actionable groups (599 recommendation-level).
  2. Resolve the 9 Orphaned knowledge finding(s) in Knowledge Freshness — start with WebEditView.jvm.kt (2), IdeaWebEditContent.kt, HobbitHoleParser.kt. — One of this dimension's main actionable groups (9 issue-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

Strongest change-coupling: compare-node-repl-codex.mjs↔NodeReplRuntime.ts 92%; DefaultCodingAgentRenderer.kt↔RendererExports.kt 85%; chat-view.ts↔useVSCode.ts 82%

Boundary-crossing change coupling: compare-node-repl-codex.mjs ↔ NodeReplRuntime.ts · ×8docs/test-scripts/compare-node-repl-codex.mjs:1
Change coupling: chat-view.ts ↔ useVSCode.ts · ×18mpp-vscode/src/providers/chat-view.ts:1
Change-coupling hub: RendererExports.kt → DefaultCodingAgentRenderer.kt, BaseRenderer.ts, CliRenderer.ts, TuiRenderer.ts · ×3mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt

What to do

  1. Resolve the 8 Boundary-crossing change coupling finding(s) in Change Coupling — start with AgentType.kt (4), WebEditPage.kt (2), compare-node-repl-codex.mjs. — One of this dimension's main actionable groups (8 issue-level).
  2. Resolve the 18 Change coupling finding(s) in Change Coupling — start with chat-view.ts (2), AutoDevInputSection.kt, ToolOrchestrator.kt. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with RendererExports.kt, InputComponents.kt, StatefulNanoRenderer.kt. — One of this dimension's main actionable groups (3 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 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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 9 platform declaration(s) and 170 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives3.5 / 10Weak✓ Tool-verified

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

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

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

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×2) — mpp-ui/src/jsMain/resources/index.html:20, mpp-ui/src/wasmJsMain/resources/index.html:346

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels4.3 / 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 control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×18) — mpp-vscode/webview/src/components/DevInInput.tsx:97, mpp-vscode/webview/src/components/FileSearchPopup.tsx:134, mpp-vscode/webview/src/components/ModelConfigDialog.tsx:135, …
  • 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. (×13) — mpp-vscode/webview/src/components/ModelConfigDialog.tsx:134, mpp-vscode/webview/src/components/ModelConfigDialog.tsx:149, mpp-vscode/webview/src/components/ModelConfigDialog.tsx:158, …
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×6) — mpp-vscode/webview/src/components/ModelConfigDialog.tsx:150, mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:622, mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:881, …

What to do

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

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

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

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

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×5) — mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1, mpp-ui/src/wasmJsMain/resources/index.html:2, mpp-viewer-web/src/commonMain/resources/viewer.html:2, …

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics2.3 / 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. (×5) — mpp-vscode/webview/src/components/CompletionPopup.tsx:104, mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:107, mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:184, …
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — mpp-vscode/webview/src/components/FileSearchPopup.tsx:35, mpp-vscode/webview/src/components/Omnibar.tsx:205
  • The repo's own CSS styles .suggestion with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. (×3) — mpp-vscode/webview/src/components/MessageList.tsx:65, mpp-vscode/webview/src/components/MessageList.tsx:66, mpp-vscode/webview/src/components/MessageList.tsx:67
  • The repo's own CSS styles .dropdown-item with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — mpp-vscode/webview/src/components/ModelSelector.tsx:93

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

  • `.rocket` moves (`animation: rocket-fly 2.5s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — mpp-ui/src/wasmJsMain/resources/index.html:101, mpp-web/index.html:101
  • `.fire-trail` moves (`animation: fire-flicker 0.1s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — mpp-ui/src/wasmJsMain/resources/index.html:134, mpp-web/index.html:134
  • `.energy-burst` moves (`animation: burst 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — mpp-ui/src/wasmJsMain/resources/index.html:167, mpp-web/index.html:167
  • `.spark` moves (`animation: spark 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — mpp-ui/src/wasmJsMain/resources/index.html:204, mpp-web/index.html:204
  • `.progress-bar` moves (`transition: width 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-ui/src/wasmJsMain/resources/index.html:292
  • `.mermaid` moves (`transition: transform 0.2s ease-in-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-viewer-web/src/commonMain/resources/mermaid.html:46
  • `.spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-viewer-web/src/commonMain/resources/viewer.html:45
  • `.diff-action-btn.accept` sets color: white on background-color: #4caf50 — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — mpp-vscode/webview/src/components/sketch/DiffRenderer.css:53
  • `.terminal-status.error` sets color: white on background-color: #f44336 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — mpp-vscode/webview/src/components/sketch/TerminalRenderer.css:39
  • `.devin-textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — mpp-vscode/webview/src/components/DevInInput.css:42
  • `.omnibar-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — mpp-vscode/webview/src/components/Omnibar.css:50
  • `.xu-btn` moves (`transition: transform 120ms ease, background 120ms ease, border-color 120ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-web/src/index.css:142
  • `.status-dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/App.css:44
  • `.loading-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/App.css:129
  • `.message` moves (`animation: fadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/MessageList.css:61
  • `.streaming-indicator .dot` moves (`animation: pulse 1.4s infinite ease-in-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/MessageList.css:118
  • `.dropdown-arrow` moves (`transition: transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/ModelSelector.css:39
  • `.streaming-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/Timeline.css:71
  • `.code-streaming-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.css:86
  • `.nanodsl-loading .spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.css:60
  • `.loading-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/sketch/SketchRenderer.css:27
  • `.terminal-running .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/sketch/TerminalRenderer.css:123
  • `.thinking-streaming .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/sketch/ThinkingRenderer.css:50
  • `.status-icon.in-progress` moves (`animation: spin 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:66
  • `.expand-arrow` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:81
  • `.progress-fill` moves (`transition: width 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:116
  • `.step-icon.spinning` moves (`animation: spin 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:251

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 45 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 vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

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

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

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

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.

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

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

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

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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

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

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

C1 · Data Protection0.0 / 10Critical✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

  • No encryption usage (javax.crypto's Cipher in ENCRYPT_MODE, Tink, Jasypt, Spring Security's Encryptors, Jetpack Security's EncryptedSharedPreferences or EncryptedFile, the Android Keystore, SQLCipher, pgcrypto) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore. — mpp-ui/src/commonMain/sqldelight/cc/unitmesh/devins/db/Session.sq:106

What to do

  • Encrypt sensitive data at rest (open the store encrypted — SQLCipher's SupportFactory for Room, a Realm encryptionKey — or encrypt the fields with Tink's AEAD or an AES/GCM Cipher, or use Jetpack Security's EncryptedSharedPreferences on Android) keeping its key in the Android Keystore or a vault, and manage server-side keys in a vault (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault). Skip if delegated to infra (Postgres TDE, KMS, etc.).
  • Enforce HTTPS on the server that receives this data: terminate TLS in it (Ktor's sslConnector, Spring's server.ssl and requiresSecure, Netty's SslContextBuilder.forServer) and send Strict-Transport-Security (Ktor's HttpsRedirect), or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
M1 · Documentation (README)8.2 / 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 a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add a README to the 3 of 14 project(s) that lack one — worth up to 0.4 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

Maturity · Maturity — Whether the 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 accuracy8.6 / 10Strong◐ 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.

  • mpp-core/README.md names `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt`, but no file or folder `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt` 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. — mpp-core/README.md:174
  • mpp-core/README.md names the package `@autodev/cli`, but no package.json of the workspace declares or depends on it. 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. — mpp-core/README.md:228
  • mpp-ios/README.md links to `PODFILE-CONFIG.md`, but `mpp-ios/PODFILE-CONFIG.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mpp-ios/README.md:148
  • mpp-ios/README.md names `build-and-run.sh`, but no file or folder `build-and-run.sh` 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. — mpp-ios/README.md:202
  • mpp-ui/docs/I18N.md links to `../CONTRIBUTING.md#translations`, but `mpp-ui/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mpp-ui/docs/I18N.md:336
  • mpp-ui/src/jvmMain/resources/README.md runs `bash scripts/convert-icon.sh`, but `scripts/convert-icon.sh` 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. — mpp-ui/src/jvmMain/resources/README.md:36
  • mpp-ui/src/test/framework/README.md runs `npx ts-node src/test/framework/cli.ts suite basic`, but `src/test/framework/cli.ts` 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. — mpp-ui/src/test/framework/README.md:142
  • mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/automation/README.md links to `../AUTOMATION_TEST_SUMMARY.md`, but `mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/AUTOMATION_TEST_SUMMARY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/automation/README.md:268

What to do

  • Reconcile the README with reality: mpp-core/README.md names `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt`, but no file or folder `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt` exists; mpp-core/README.md names the package `@autodev/cli`, but no package.json of the workspace declares or depends on it; mpp-ios/README.md links to `PODFILE-CONFIG.md`, but `mpp-ios/PODFILE-CONFIG.md` does not exist; mpp-ios/README.md names `build-and-run.sh`, but no file or folder `build-and-run.sh` exists; mpp-ui/docs/I18N.md links to `../CONTRIBUTING.md#translations`, but `mpp-ui/CONTRIBUTING.md` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified

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

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

  • 3033/3140 types (97%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.

What to do

  • Keep implementation types off the public surface (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`) so internals can change without breaking consumers.
P2 · Observability6.8 / 10Adequate✓ Tool-verified

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

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

  • Only 6/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `mpp-ios`, `mpp-viewer-web`, `mpp-vscode`, `xiuper-fs`.
  • `mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts` reports through `console.*` at line 173 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:173
  • `mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts` reports through `console.*` at line 177 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:177
  • `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:49
  • `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 100 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:100
  • `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:161
  • `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 206 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:206
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 95 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:95
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 107 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:107
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:117
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 157 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:157
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 169 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:169
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 197 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:197
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 213 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:213
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 252 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:252
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 424 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:424
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 445 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:445
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:45
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 64 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:64
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 65 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:65
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:98
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 100 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:100
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 142 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:142
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 153 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:153
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 175 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:175
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 355 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:355
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 385 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:385
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 418 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:418
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 478 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:478
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 486 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:486
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 492 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:492
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 523 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:523
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 533 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:533
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 546 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:546
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 560 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:560
  • `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 564 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:564
  • `mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts` reports through `console.*` at line 36 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:36
  • `mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts` reports through `console.*` at line 72 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:72
  • `mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts` reports through `console.*` at line 85 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:85
  • `mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts` reports through `console.*` at line 89 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:89

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
  • Add OpenTelemetry tracing/metrics (opentelemetry-java or Micrometer) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling10.0 / 10Exemplary○ Nothing flagged

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

  • Dependabot is configured but does not watch `npm`, `pip` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.

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.

  • `HttpClient {` 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. (×15) — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:33, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:37, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tracker/GitHubIssueTracker.kt:31, …
  • `HttpClient(` 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. (×17) — mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/clients/CustomOpenAILLMClient.kt:137, mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt:8, mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.js.kt:17, …
  • `HttpClient.newBuilder(` 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. — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/nano/ComposeActionHandler.kt:42

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
PF2 · Allocation hygiene6.0 / 10Adequate✓ 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 29 use(s) across 321,451 production line(s) (~0.1/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
  • Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from 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.

  • `create` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:51
  • `process` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs. — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/processor/VelocityExprProcessor.kt:15
  • `fetch_chat_completion` is async and calls requests.post — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — example/custom_llm_server/openai_proxy.py:25
  • `existsSync` in `readActiveExecRegistrySnapshot` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — docs/test-scripts/compare-node-repl-codex.mjs:259
  • `existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — docs/test-scripts/compare-node-repl-codex.mjs:628, docs/test-scripts/compare-node-repl-codex.mjs:631
  • `fs.readFileSync` in `readTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:426
  • `fs.existsSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:449
  • `fs.mkdirSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:450
  • `fs.writeFileSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:453
  • `fs.existsSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — mpp-ui/src/jsMain/typescript/i18n/index.ts:127, mpp-ui/src/jsMain/typescript/i18n/index.ts:134
  • `fs.mkdirSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/i18n/index.ts:128
  • `fs.readFileSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/i18n/index.ts:135
  • `fs.writeFileSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/i18n/index.ts:147
  • `fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:47, mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:57
  • `fs.readFileSync` in `readFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:137
  • `fs.readFileSync` in `registerDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:92
  • `fs.existsSync` in `runDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:125, mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:168
  • `execSync` in `fetchGitDiff` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:450, mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:455, mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:461
  • `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — mpp-vscode/src/services/config-manager.ts:121, mpp-vscode/src/services/config-manager.ts:125
  • `fs.mkdirSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-vscode/src/services/config-manager.ts:122
  • `fs.readFileSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-vscode/src/services/config-manager.ts:129
  • `fs.existsSync` in `saveConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-vscode/src/services/config-manager.ts:183
  • `fs.mkdirSync` in `saveConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-vscode/src/services/config-manager.ts:184
  • `fs.writeFileSync` in `saveConfig` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — mpp-vscode/src/services/config-manager.ts:217

What to do

  • Kotlin: call the suspend function directly instead of wrapping it in runBlocking, use delay() instead of Thread.sleep, and move unavoidable blocking I/O into withContext(Dispatchers.IO).
  • Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety8.9 / 10Strong✓ 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 / 10Strong✓ 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.

  • 14 duplicated blocks under the repository root have copies in at least two of the sibling directories mpp-codegraph, mpp-core, mpp-ui, mpp-vscode, mpp-web — 11 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20
  • mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:243 · mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:294 — the two spans are one implementation copied and then locally edited — 902 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. — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:243
  • mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:114 · mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:56 — the two spans are one implementation copied and then locally edited — 376 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. — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:114
  • mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20 · mpp-vscode/src/services/config-manager.ts:19 — the two spans are one implementation copied and then locally edited — 401 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. — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20
  • mpp-core/webpack.config.d/node-polyfills.js:5 · mpp-ui/webpack.config.d/node-polyfills.js:5 — 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. — mpp-core/webpack.config.d/node-polyfills.js:5
  • mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:218 · mpp-vscode/src/services/config-manager.ts:51 — 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. — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:218
  • mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1455 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1606 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1670 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1740 — all 4 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1455
  • mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169 · mpp-web/src/services/LLMService.ts:118 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169
  • mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.tsx:23 · mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:25 — the two spans are one implementation copied and then locally edited — 135 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. — mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.tsx:23
  • mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1888 — 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807
  • mpp-vscode/src/actions/auto-actions.ts:46 · mpp-vscode/src/actions/auto-actions.ts:105 · mpp-vscode/src/actions/auto-actions.ts:171 — 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. — mpp-vscode/src/actions/auto-actions.ts:46
  • mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:280 · mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:69 — the two spans are one implementation copied and then locally edited — 139 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. — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:280
  • mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:155 · mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:197 — the two spans are one implementation copied and then locally edited — 139 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:155
  • mpp-ui/src/jsMain/typescript/agents/LLMService.ts:60 · mpp-ui/src/jsMain/typescript/agents/LLMService.ts:119 — 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. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:60
  • mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:189 · mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:219 — 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. — mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:189
  • mpp-vscode/src/commands/codelens-commands.ts:102 · mpp-vscode/src/commands/codelens-commands.ts:123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — mpp-vscode/src/commands/codelens-commands.ts:102
  • mpp-vscode/src/actions/auto-actions.ts:81 · mpp-vscode/src/actions/auto-actions.ts:149 — 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. — mpp-vscode/src/actions/auto-actions.ts:81
  • mpp-vscode/src/providers/devins-completion.ts:90 · mpp-vscode/src/providers/devins-completion.ts:107 · mpp-vscode/src/providers/devins-completion.ts:124 — 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. — mpp-vscode/src/providers/devins-completion.ts:90
  • mpp-vscode/src/services/diff-manager.ts:134 · mpp-vscode/src/services/diff-manager.ts:161 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — mpp-vscode/src/services/diff-manager.ts:134
  • mpp-vscode/webview/src/components/FileChip.tsx:73 · mpp-vscode/webview/src/components/FileSearchPopup.tsx:40 — 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. — mpp-vscode/webview/src/components/FileChip.tsx:73
  • mpp-vscode/webview/src/components/FileSearchPopup.tsx:114 · mpp-vscode/webview/src/components/Omnibar.tsx:159 — the two spans are one implementation copied and then locally edited — 154 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. — mpp-vscode/webview/src/components/FileSearchPopup.tsx:114
  • mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1773 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1826 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1907 — 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1773
  • mpp-ui/src/jsMain/typescript/ui/App.tsx:76 · mpp-ui/src/jsMain/typescript/ui/App.tsx:114 — 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. — mpp-ui/src/jsMain/typescript/ui/App.tsx:76
  • mpp-vscode/src/commands/codelens-commands.ts:144 · mpp-vscode/src/commands/codelens-commands.ts:166 · mpp-vscode/src/commands/codelens-commands.ts:188 — 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. — mpp-vscode/src/commands/codelens-commands.ts:144
  • mpp-vscode/webview/src/components/ModelConfigDialog.tsx:132 · mpp-vscode/webview/src/components/ModelConfigDialog.tsx:155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — mpp-vscode/webview/src/components/ModelConfigDialog.tsx:132
  • mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:131 · mpp-vscode/src/bridge/mpp-core.ts:376 — 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. — mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:131
  • mpp-ui/src/jsMain/typescript/index.tsx:62 · mpp-ui/src/jsMain/typescript/index.tsx:354 — 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. — mpp-ui/src/jsMain/typescript/index.tsx:62
  • mpp-ui/src/jsMain/typescript/index.tsx:177 · mpp-ui/src/jsMain/typescript/index.tsx:235 — 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. — mpp-ui/src/jsMain/typescript/index.tsx:177
  • mpp-vscode/src/providers/code-element-parser.ts:508 · mpp-vscode/src/providers/code-element-parser.ts:543 · mpp-vscode/src/providers/code-element-parser.ts:578 · mpp-vscode/src/providers/code-element-parser.ts:598 — 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. — mpp-vscode/src/providers/code-element-parser.ts:508
  • mpp-vscode/src/services/ide-server.ts:113 · mpp-vscode/src/services/ide-server.ts:130 — 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. — mpp-vscode/src/services/ide-server.ts:113
  • mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:95 · mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:94 — the two spans are one implementation copied and then locally edited — 87 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. — mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:95
  • mpp-web/src/App.tsx:235 · mpp-web/src/App.tsx:252 — 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. — mpp-web/src/App.tsx:235
  • mpp-ui/scripts/analyze-test-results.cjs:104 · mpp-ui/scripts/validate-scenarios.js:287 — the two spans are one implementation copied and then locally edited — 51 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. — mpp-ui/scripts/analyze-test-results.cjs:104
  • mpp-codegraph/webpack.config.d/node-polyfills.js:7 · mpp-core/webpack.config.d/node-polyfills.js:5 · mpp-ui/webpack.config.d/node-polyfills.js:5 — the 3 copies are spread across 3 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. — mpp-codegraph/webpack.config.d/node-polyfills.js:7
  • mpp-ui/src/jsMain/typescript/agents/LLMService.ts:86 · mpp-ui/src/jsMain/typescript/agents/LLMService.ts:147 · mpp-web/src/services/LLMService.ts:96 — the 3 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. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:86
  • mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:59 · mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:96 — 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. — mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:59
  • mpp-vscode/src/providers/code-element-parser.ts:487 · mpp-vscode/src/providers/code-element-parser.ts:503 · mpp-vscode/src/providers/code-element-parser.ts:523 · mpp-vscode/src/providers/code-element-parser.ts:538 · +4 more site(s) not listed — all 8 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. — mpp-vscode/src/providers/code-element-parser.ts:487
  • mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:76 · mpp-ui/src/jsMain/typescript/index.tsx:383 · mpp-ui/src/jsMain/typescript/index.tsx:556 · mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:71 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:76
  • mpp-ui/src/jsMain/typescript/index.tsx:121 · mpp-ui/src/jsMain/typescript/index.tsx:379 · mpp-ui/src/jsMain/typescript/index.tsx:553 — 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. — mpp-ui/src/jsMain/typescript/index.tsx:121
  • mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:35 · mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:47 — 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. — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:35

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity4.4 / 10Weak✓ 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.

  • classifyToolKind has cyclomatic complexity 55 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. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:194
  • formatToolCallDisplay has cyclomatic complexity 40 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:232
  • validateScenario has cyclomatic complexity 36 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — mpp-ui/scripts/validate-scenarios.js:57
  • (anonymous) has cyclomatic complexity 36 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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. — mpp-vscode/webview/src/App.tsx:86
  • readTopLevelBindingDeclarations has cyclomatic complexity 35 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1431
  • evaluateCondition has cyclomatic complexity 34 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:158
  • findVariableDeclarationEnd has cyclomatic complexity 33 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1723
  • sessionUpdate has cyclomatic complexity 31 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:334
  • ModelConfigDialog has cyclomatic complexity 28 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. — mpp-vscode/webview/src/components/ModelConfigDialog.tsx:40
  • formatToolCallDisplay has cyclomatic complexity 25 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. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:282
  • runDocument has cyclomatic complexity 23 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:106
  • WebUiApp has cyclomatic complexity 23 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-web/src/App.tsx:7
  • findMatchingBraceEnd has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1657
  • findBlockDeclarationEnd has cyclomatic complexity 21 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 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. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1593
  • runCodingAgent has cyclomatic complexity 21 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 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. — mpp-ui/src/jsMain/typescript/index.tsx:62
  • parseTestResult has cyclomatic complexity 20 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 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. — mpp-ui/scripts/analyze-test-results.cjs:154
  • RenderProgress has cyclomatic complexity 20 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. — mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:809
  • handleLine has cyclomatic complexity 20 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/node-repl/server.ts:97
  • buildFromConfig has cyclomatic complexity 19 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/test/framework/loaders/JsonScenarioLoader.ts:128

What to do

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

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

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

  • mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts has 1803 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1
  • mpp-vscode/src/providers/chat-view.ts has 1085 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-vscode/src/providers/chat-view.ts:1
  • mpp-vscode/webview/src/components/nano/NanoRenderer.tsx has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:1
  • mpp-vscode/src/bridge/mpp-core.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-vscode/src/bridge/mpp-core.ts:1
  • mpp-vscode/src/providers/code-element-parser.ts has 605 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-vscode/src/providers/code-element-parser.ts:1
  • mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts has 604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:1
  • mpp-ui/src/jsMain/typescript/index.tsx has 509 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/index.tsx:1
  • mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts has 506 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:1
  • mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts has 495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:1
  • mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts has 488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:1
  • mpp-vscode/webview/src/App.tsx has 470 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-vscode/webview/src/App.tsx:1
  • mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:1
  • mpp-web/src/App.tsx has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-web/src/App.tsx:1
  • mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:1

What to do

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

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

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

  • mpp-ui/vitest.config.ts declares environment "node", and no package here declares a DOM implementation (jsdom / happy-dom), a component testing library or a browser runner — so none of the 36 unreached component module(s) can be tested as written, however the suite is authored: mpp-vscode/webview/src/components/nano/NanoRenderer.tsx, mpp-ui/src/jsMain/typescript/index.tsx, mpp-vscode/webview/src/App.tsx, mpp-web/src/App.tsx, mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx, mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx and 30 more. Add a DOM environment and a component testing library (for example jsdom + @testing-library, or the runner's browser mode), then test the components. Reported once because these files share one cause, not one omission each. — mpp-ui/vitest.config.ts:1
  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×34) — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1, mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:1, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:1, …

What to do

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

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each 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 Code6.8 / 10Adequate✓ 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.

  • 3 file(s) (~156 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • Unreachable from the 20 application, 22 tooling and 43 test entry point(s) detected in this repo. Gate removals on `npm run build:ts` — an undetected custom entry would make these reachable.
  • no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×9) — mpp-web/src/App.tsx, mpp-ui/src/jsMain/typescript/design-system/index.ts, mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts, …
  • no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 2 in-repo import(s) from 1 other file(s) do name it (mpp-vscode/webview/src/components/nano/index.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 — mpp-vscode/webview/src/components/nano/NanoActionHandler.ts
  • no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (mpp-web/src/App.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 — mpp-web/src/services/LLMService.ts
  • no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (mpp-web/src/App.tsx, mpp-web/src/services/LLMService.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 — mpp-web/src/services/ConfigService.ts
  • Nothing imports this binding — it is safe to review for removal. (×12) — mpp-ui/src/jsMain/typescript/constants/asciiArt.ts:13, mpp-ui/src/jsMain/typescript/i18n/types.ts:131, mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts:158, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in mpp-ui/src/jsMain/typescript/design-system/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in mpp-ui/src/jsMain/typescript/design-system/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — mpp-ui/src/jsMain/typescript/design-system/colors.ts:409, mpp-ui/src/jsMain/typescript/design-system/theme-helpers.ts:165
  • Nothing ultimately consumes this binding: its only referrer is the re-export in mpp-vscode/webview/src/components/sketch/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in mpp-vscode/webview/src/components/sketch/index.ts in the same commit, or the barrel will import a name that no longer exists. — mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx:78
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×3) — mpp-ui/scripts/generate-test-scenario.js:93, mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:517, mpp-vscode/src/providers/code-element-parser.ts:34
  • This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments. (×4) — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:289, mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:290, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:19, …
  • Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect. (×4) — mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:37, mpp-ui/src/jsMain/typescript/utils/domainDictUtils.ts:34, mpp-ui/src/jsMain/typescript/utils/domainDictUtils.ts:36, …

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 Hygiene3.5 / 10Weak✓ Tool-verified

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

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

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — mpp-codegraph/webpack.config.d/node-polyfills.js:5, mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.tsx:38
  • Declared in mpp-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.0 / 10Strong✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • mpp-vscode/src/actions/auto-actions.ts → mpp-vscode/src/services/diff-manager.ts → mpp-vscode/src/extension.ts → mpp-vscode/src/commands/codelens-commands.ts → mpp-vscode/src/actions/auto-actions.ts (one verified cycle inside a mutually-dependent group of 5 files) — mpp-vscode/src/actions/auto-actions.ts:10

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • `https://cdn.jsdelivr.net/npm/mermaid@11.4.0/dist/mermaid.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 2 such include(s) across the repository's markup. — mpp-viewer-web/src/commonMain/resources/mermaid.html:99

What to do

  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
X1 · Async correctness7.9 / 10Strong✓ Tool-verified

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.

  • `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too. (×9) — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:88, mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/PlanReviewAction.kt:76, mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/ShireDebugProcess.kt:61, …

What to do

  • `runBlocking` inside a coroutine
X12 · Unreachable branch8.0 / 10Strong✓ Tool-verified

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.

  • The when subject is `strategy.lowercase()`, so every value reaching these branches has already been lower-cased by `lowercase()` (line 107). The condition `"selectAll"` carries a letter of the opposite case, and a `when` condition compares with `==`, so it cannot equal that subject for ANY input — this branch is dead and whatever it was meant to handle silently falls to a later branch or the `else`. Match the normalised spelling (`"selectall"`), or drop the normaliser and compare with `equals(…, ignoreCase = true)`. — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/select/SelectElementStrategy.kt:110

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X13 · Undrained process stream5.7 / 10Adequate✓ Tool-verified

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.

  • The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `diffProcess.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `diffProcess.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`). — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:234
  • The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`). (×3) — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/linecount/CmdWrapper.kt:100, mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:77, mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:133

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
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 document3.5 / 10Weak✓ Tool-verified

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.

  • `NanoExpressionEvaluator.jsonElementToRuntimeValue` is public and takes `el: JsonElement ?` from its caller, and it calls itself at line 37 with a piece of `el` (and at line 38) — the function is not `tailrec`, so every call is a real frame — and nowhere in `NanoExpressionEvaluator.jsonElementToRuntimeValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `NanoExpressionEvaluator.jsonElementToRuntimeValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`. — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:37

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness6.3 / 10Adequate✓ Tool-verified

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.

  • `DiffManager` declares a disposal member — so it has told every caller it holds something worth releasing — and it constructs `onDidChangeEmitter` itself (line 62, `new vscode.EventEmitter`), which makes that instance its own. But `onDidChangeEmitter` is named in none of the methods the disposal search covered: `dispose` (line 80) — that is the disposal member plus every method it calls on `this` BY NAME, so a release reached through a base class, a callback or a registry is not followed and is worth checking before acting. The field is released nowhere else in the class and is never handed to anything else, so no other owner can be releasing it. On what was read, the class's disposal releases everything except the one thing it owns. Whatever `vscode.EventEmitter` holds until its own `dispose()` runs — the listeners subscribed to it, a pending timer, GPU memory — outlives this instance's disposal: a subscriber that registered through it stays attached, and anything that holds the subscription keeps the whole chain reachable. Release it in the disposal member (`this.onDidChangeEmitter.dispose()`), or, if it truly does not need releasing, drop the disposal member so the claim and the behaviour agree. — mpp-vscode/src/services/diff-manager.ts:62

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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 propagation9.8 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on an AbortSignal or the coroutine's cancellation (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 47/49 functions that make a cancellable request (fetch, axios, ky, ofetch; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation 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` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `getProjects` 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 })`. — mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:185
  • `healthCheck` 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 })`. — mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:199

What to do

  • Thread an AbortSignal or the coroutine's cancellation through functions that make requests, so the work stops when its caller gives up.
X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

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

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.

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.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

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

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

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

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

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 handling5.3 / 10Adequate✓ Tool-verified

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

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

  • `catch (e: Throwable)` 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. — mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:636
  • `catch (_: Exception)` 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. — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:72
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:113, mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/FilePathCompletionProvider.kt:130
  • `catch (e: Exception)` 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. (×33) — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:57, mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:92, mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:196, …
  • `catch (_: Throwable)` 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. (×3) — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:25, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:39, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:125

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.

X4 · Structured logging5.1 / 10Adequate✓ Tool-verified

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

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

  • `error` at line 39 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:39
  • `error` at line 50 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:50
  • `error` at line 173 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:173
  • `error` at line 184 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:184
  • `warn` at line 92 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/AutoTestInMenuAction.kt:92
  • `info` at line 47 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/base/ChatBaseAction.kt:47
  • `error` at line 35 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/console/FixThisAction.kt:35
  • `info` at line 77 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/custom/CustomAgentExecutor.kt:77
  • `error` at line 43 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/custom/CustomAgentChatProcessor.kt:43
  • `warn` at line 80 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/SpecKitTemplateCompiler.kt:80
  • `warn` at line 86 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/SpecKitTemplateCompiler.kt:86
  • `error` at line 77 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt:77
  • `error` at line 120 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt:120
  • `warn` at line 45 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/action/CustomPromptConfig.kt:45
  • `error` at line 75 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/compile/VariableTemplateCompiler.kt:75
  • `info` at line 26 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/document/CustomLivingDocTask.kt:26
  • `info` at line 39 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/document/CustomLivingDocTask.kt:39
  • `warn` at line 171 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/team/CustomActionPrompt.kt:171
  • `info` at line 66 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt:66
  • `warn` at line 76 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt:76
  • `debug` at line 46 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:46
  • `debug` at line 80 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:80
  • `debug` at line 92 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:92
  • `warn` at line 59 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMInlayManagerImpl.kt:59
  • `debug` at line 152 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMInlayManagerImpl.kt:152
  • `debug` at line 159 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMInlayManagerImpl.kt:159
  • `debug` at line 26 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMCommandListener.kt:26
  • `debug` at line 42 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMCommandListener.kt:42
  • `debug` at line 56 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMCommandListener.kt:56
  • `error` at line 67 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt:67
  • `info` at line 135 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt:135
  • `error` at line 147 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt:147
  • `info` at line 243 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt:243
  • `info` at line 256 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt:256
  • `info` at line 36 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. (×2) — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/LivingDocumentationTask.kt:36, mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionTask.kt:36
  • `info` at line 48 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/LivingDocumentationTask.kt:48
  • `info` at line 117 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/LivingDocPromptBuilder.kt:117
  • `info` at line 59 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionTask.kt:59
  • `error` at line 97 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text. — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionTask.kt:97

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.8 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

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

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 Health58%AdequateAcceptable, with room to improve.
Architecture88%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity73%StrongStrongest area.
Readiness53%Adequate — gated by R4, R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security43%Weak — gated by D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility39%Weak — gated by AC1, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 5 check(s) recorded observations but carry no score

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

  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 24 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 34 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Repo shows no audit-logging mechanism (an audit-log table or model — an Exposed table, a data class, a Room entity or a SQL migration's table named for it — Hibernate Envers' @Audited, a JPA entity listener, Hibernate event listener or jOOQ RecordListener that records each change) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 38 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/bui…; 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.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D12 Dependency Hygiene — Not scored — 12 Maven/Gradle manifest(s) were read, stating a version for 163 dependency(ies) and leaving 7 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — Not scored — this repository's 163 declared JVM dependency coordinate(s) were read from its 12 Maven/Gradle manifest(s), but Maven Central could not be asked for the licence of 131 of them (HTTP 429 Too Many Requests from https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter/5.10.0/junit-jupiter-5.10.0.pom), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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. 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.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.kt), 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) — 33 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.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — mpp-ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • D9 Test Distribution — Test distribution not scored — polyglot repository, one half's tests are uncountable
  • DM1 Domain Modelling — applicable but not scored (4 signals for this style, 3 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (entities that raise its domain events); 1237 value object(s); 10 domain event(s); a Domain/Aggregates/ValueObjects layer; a top-level examples/ tree: a library or framework whose examples are its consumers — these types are building blocks, not a domain
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P8 Schema migrations — Exposed is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) 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
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@Benchmark` in a Java, Kotlin or Scala file importing JMH or kotlinx-benchmark, Jetpack Benchmark's `measureRepeated` in a file importing androidx.benchmark, or JMH/kotlinx-benchmark/androidx.benchmark in a pom.xml, Gradle or sbt build, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • 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.

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 — 166 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
  • + 54 more in this group — see findings.md.
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label mpp-vscode/webview/src/components/FileSearchPopup.tsx:134 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:135 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:159 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:176 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:201 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:234 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:247 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/Omnibar.tsx:185 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:587 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:698 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:766 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:868 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:881 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:889 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:890 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-web/src/App.tsx:230 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-web/src/App.tsx:247 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label mpp-web/src/App.tsx:264 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <label> that labels no control · ×13
  • <label> that labels no control mpp-vscode/webview/src/components/ModelConfigDialog.tsx:134 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:149 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:158 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:174 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:200 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:233 — 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 mpp-vscode/webview/src/components/ModelConfigDialog.tsx:246 — 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 mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:867 — 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 mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:880 — 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 mpp-web/src/App.tsx:207 — 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 mpp-web/src/App.tsx:229 — 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 mpp-web/src/App.tsx:246 — 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 mpp-web/src/App.tsx:263 — 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.
D34 · Knowledge Freshness · Orphaned knowledge · ×9
  • Orphaned knowledge mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/HobbitHoleParser.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/SmartEditTool.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/http/RestFs.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-vscode/src/providers/code-element-parser.ts:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternFuncProcessor.kt:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
X1 · Async correctness · `runBlocking` inside a coroutine · ×9
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:88 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/PlanReviewAction.kt:76 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/ShireDebugProcess.kt:61 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShirePreviewEditor.kt:192 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/ShowWebviewProcessor.kt:114 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/ShireRunner.kt:98 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/ShireDefaultLlmExecutor.kt:62 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/CustomRemoteAgentLlmExecutor.kt:37 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
  • `runBlocking` inside a coroutine mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/startup/ShireFileModifier.kt:52 — `runBlocking` parks the calling thread until its block finishes, and this is already running in a coroutine, on a dispatcher's thread. On a single-threaded dispatcher (`Dispatchers.Main`, a `limitedParallelism(1)` view) the block can need that very thread to make progress — a deadlock — and on any dispatcher it takes a thread out of the pool for the wait; the library documents that `runBlocking` "should not be used from a coroutine". The suspending call can simply be made here: call it directly, or `coroutineScope { … }` / `withContext(…) { … }` for a block. Where a non-suspending function in between forces the bridge, make that function `suspend` too.
D35 · Change Coupling · Boundary-crossing change coupling · ×8
  • Boundary-crossing change coupling: compare-node-repl-codex.mjs ↔ NodeReplRuntime.ts docs/test-scripts/compare-node-repl-codex.mjs:1 — `docs/test-scripts/compare-node-repl-codex.mjs` (context docs) and `mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts` (context mpp-ui) sit in DIFFERENT parts of the tree yet change together 92% of the time (22 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `6cb80ab2` feat(mpp-ui): support node repl top level export; `62bab37f` feat(mpp-ui): persist top level await bindings; `1c42cd12` feat(mpp-ui): align node repl console shim — run `git show` on any of them.
  • Boundary-crossing change coupling: AgentType.kt ↔ AgentInterfaceRouter.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt` (context mpp-core) and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt` (context mpp-ui) sit in DIFFERENT parts of the tree yet change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `aaf43960` chore: Remove ACP agent UI components from mpp-ui module; `6d15e840` feat(ui): add ACP agent configuration dialog and page #535; `760e45d9` feat(artifact): add AutoDev Unit Artifact system for reversible artif… — run `git show` on any of them.
  • Boundary-crossing change coupling: AgentType.kt ↔ CodingAgentPage.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt` (context mpp-core) and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt` (context mpp-ui) sit in DIFFERENT parts of the tree yet change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `aaf43960` chore: Remove ACP agent UI components from mpp-ui module; `6d15e840` feat(ui): add ACP agent configuration dialog and page #535; `eb0d6696` feat(chatdb): add ChatDB agent for text-to-SQL interactions (at that commit the file was still `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentChatInterface.kt`) — run `git show` on any of them.
  • Boundary-crossing change coupling: AgentType.kt ↔ TopBarMenuDesktop.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt` (context mpp-core) and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt` (context mpp-ui) sit in DIFFERENT parts of the tree yet change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `aaf43960` chore: Remove ACP agent UI components from mpp-ui module; `6d15e840` feat(ui): add ACP agent configuration dialog and page #535; `eb0d6696` feat(chatdb): add ChatDB agent for text-to-SQL interactions — run `git show` on any of them.
  • Boundary-crossing change coupling: AgentType.kt ↔ TopBarMenuMobile.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/AgentType.kt` (context mpp-core) and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt` (context mpp-ui) sit in DIFFERENT parts of the tree yet change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `aaf43960` chore: Remove ACP agent UI components from mpp-ui module; `6d15e840` feat(ui): add ACP agent configuration dialog and page #535; `eb0d6696` feat(chatdb): add ChatDB agent for text-to-SQL interactions — run `git show` on any of them.
  • Boundary-crossing change coupling: StatefulNanoRenderer.kt ↔ HtmlRenderer.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt` (context mpp-ui) and `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/HtmlRenderer.kt` (context xiuper-ui) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `9fcc4f91` feat(nano): refactor Nano components and rendering; `73e4e337` refactor(nano): consolidate rendering system; `6cbc5c40` feat: Add P0 core components and GenUI components to NanoDSL — run `git show` on any of them.
  • Boundary-crossing change coupling: WebEditPage.kt ↔ WebEditView.jvm.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt` (context mpp-ui) and `mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` (context mpp-viewer-web) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `f2339dea` feat(webedit): add WebAssembly support for web editing #511; `1629fb6d` feat(webedit): add preview and automation testing #511; `2ec7291e` feat(webedit): add error handling and display #511 — run `git show` on any of them.
  • Boundary-crossing change coupling: WebEditPage.kt ↔ WebEditBridgeScript.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt` (context mpp-ui) and `mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeScript.kt` (context mpp-viewer-web) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `7da92fb0` feat(webedit): add automation support and update bridge files; `f2339dea` feat(webedit): add WebAssembly support for web editing #511; `1629fb6d` feat(webedit): add preview and automation testing #511 — run `git show` on any of them.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×7
  • Click handler on a non-interactive <div> mpp-vscode/webview/src/components/CompletionPopup.tsx:104 — 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> mpp-vscode/webview/src/components/FileSearchPopup.tsx:35 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> mpp-vscode/webview/src/components/Omnibar.tsx:205 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:107 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:184 — 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> mpp-vscode/webview/src/components/sketch/ThinkingRenderer.tsx:31 — 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> mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:71 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×4
  • Clickable element isn't keyboard-operable mpp-vscode/webview/src/components/MessageList.tsx:65 — The repo's own CSS styles .suggestion with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable mpp-vscode/webview/src/components/MessageList.tsx:66 — The repo's own CSS styles .suggestion with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable mpp-vscode/webview/src/components/MessageList.tsx:67 — The repo's own CSS styles .suggestion with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable mpp-vscode/webview/src/components/ModelSelector.tsx:93 — The repo's own CSS styles .dropdown-item with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels · <textarea> without a programmatic label · ×3
  • <textarea> without a programmatic label mpp-vscode/webview/src/components/DevInInput.tsx:97 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:610 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label mpp-web/src/App.tsx:363 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <select> without a programmatic label · ×3
  • <select> without a programmatic label mpp-vscode/webview/src/components/ModelConfigDialog.tsx:150 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:622 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label mpp-web/src/App.tsx:208 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
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
R8 · Dependency Hygiene · Unlisted import 'copy-webpack-plugin' · ×1
  • Unlisted import 'copy-webpack-plugin' mpp-codegraph/webpack.config.d/node-polyfills.js:5 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@xiuper/ui' · ×1
  • Unlisted import '@xiuper/ui' mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.tsx:38 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (4 files) · ×1
  • Import cycle (4 files) mpp-vscode/src/actions/auto-actions.ts:10 — mpp-vscode/src/actions/auto-actions.ts → mpp-vscode/src/services/diff-manager.ts → mpp-vscode/src/extension.ts → mpp-vscode/src/commands/codelens-commands.ts → mpp-vscode/src/actions/auto-actions.ts (one verified cycle inside a mutually-dependent group of 5 files)
Serious — 1698 finding(s)
D17 · Explicit Debt · TodoComment · ×92
  • TodoComment mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/Platform.kt:52 — // TODO: Consider providing a Context-aware initialization or companion method — 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/PRReviewServiceFactory.kt:48 — // TODO: Implement BitbucketPRReviewService — 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/PRReviewServiceFactory.kt:52 — // TODO: Implement AzureDevOpsPRReviewService — 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/SelfHealingLocator.kt:73 — // TODO: Call LLM service and parse response — 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/BrowserActionExecutor.kt:328 — // TODO: Handle modifiers — 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:132 — // TODO: 实现警告收集 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:179 — // TODO: 实现 Velocity 表达式的处理 — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:885 — // TODO: Parse resource structure when SDK documentation is available — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:57 — // TODO: Integrate with KCEF accessibility API — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:63 — // TODO: Integrate with WebEditBridge.domTree — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:69 — // TODO: Integrate with WebEditBridge.captureScreenshot — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:75 — // TODO: Integrate with WebEditBridge to get actionable elements — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:87 — // TODO: Query element attributes from browser — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:92 — // TODO: Check document.readyState via bridge — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:97 — // TODO: Get from WebEditBridge.currentUrl — 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:102 — // TODO: Get from WebEditBridge.pageTitle — 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:398 — // TODO: Parse diff to extract file changes, additions, and deletions — 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.wasmJs.kt:12 — // TODO: 实现 WASM 文件系统支持 — 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.wasmJs.kt:18 — // TODO: 实现 WASM 文件系统支持 — 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.wasmJs.kt:24 — // TODO: 实现 WASM 文件系统支持 — 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.wasmJs.kt:54 — // TODO: 实现 WASM 文件系统支持 — 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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/LLMApplyInlaysAction.kt:69 — // todo: update this to use the new API — 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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/rename/RenameLookupManagerListener.kt:25 — // TODO: spike why TypeScript not trigger this listener when rename a class, function, but Java does — 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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/schema/InlayCodeCompletePromptsSchemaFileProvider.kt:12 — //todo: refactor provider to reduce duplicate code — 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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/post/PostProcessorContext.kt:64 — // todo: refactor to GlobalVariableContext — 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.
  • + 67 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×79
  • MethodTooLong: ChatDBStepCardKt.StepDetails mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:168 — MethodTooLong — StepDetails runs 366 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× 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: IdeaAgentAppKt.IdeaAgentApp mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt:67 — MethodTooLong — IdeaAgentApp runs 335 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× 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: ModelConfigDialogKt.ModelConfigDialog mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:38 — MethodTooLong — ModelConfigDialog runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.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: IdeaKnowledgeContentKt.ChatMessageItem mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:626 — MethodTooLong — ChatMessageItem runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ToolConfigDialogKt.ToolConfigDialog mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:34 — MethodTooLong — ToolConfigDialog runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: jvmKt.LiveTerminalItem mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:76 — MethodTooLong — LiveTerminalItem runs 254 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NanoDSLBlockRendererKt.NanoDSLBlockRenderer mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:77 — MethodTooLong — NanoDSLBlockRenderer 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.
  • MethodTooLong: IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:142 — MethodTooLong — IdeaMcpConfigDialogContent runs 246 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× 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: XiuperLaunchScreenKt.XiuperLaunchScreen mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/launch/XiuperLaunchScreen.kt:48 — MethodTooLong — XiuperLaunchScreen runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: jvmKt.WebEditView mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — MethodTooLong — WebEditView runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: jvmKt.WebEditView mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — MethodTooLong — WebEditView runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× 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: jvmKt.WebEditView mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — MethodTooLong — WebEditView runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× 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: jvmKt.FileViewerPanel mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:23 — MethodTooLong — FileViewerPanel runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× 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: CreateSessionDialogKt.CreateSessionDialog mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:32 — MethodTooLong — CreateSessionDialog runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PatternFuncProcessor.patternFunctionExecute mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternFuncProcessor.kt:45 — MethodTooLong — patternFunctionExecute runs 212 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 112 over it, 2.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: IdeaToolCallBubbleKt.IdeaToolCallBubble mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:44 — MethodTooLong — IdeaToolCallBubble runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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: DataSourceConfigPaneKt.DataSourceConfigPane mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:29 — MethodTooLong — DataSourceConfigPane runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: wasmJsKt.getMermaidHtml mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.wasmJs.kt:9 — MethodTooLong — getMermaidHtml runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DocumentCli.main mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:38 — MethodTooLong — main runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: StructuredInfoPaneKt.DocQLResultView mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:312 — MethodTooLong — DocQLResultView runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DocQLResultFormatter.formatDocQLResult mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:413 — MethodTooLong — formatDocQLResult runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RoutingKt.configureRouting mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:27 — MethodTooLong — configureRouting runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.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.
  • MethodTooLong: ArtifactCli.main mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:43 — MethodTooLong — main runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: ModelSelectorKt.ModelSelector mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelSelector.kt:29 — MethodTooLong — ModelSelector runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DocQLStatsSectionKt.DocQLStatsSection mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:34 — MethodTooLong — DocQLStatsSection runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 54 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×38
  • Swallowed exception (caught, then discarded) mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:636 — `catch (e: Throwable)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:72 — `catch (_: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:57 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:92 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:196 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:268 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:278 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:43 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:52 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:84 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:138 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:27 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:40 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:65 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:74 — `catch (e: Exception)` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:155 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgent.kt:425 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/context/AgentContextDiscovery.kt:226 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.kt:128 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:135 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:25 — `catch (_: Throwable)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:39 — `catch (_: Throwable)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:125 — `catch (_: Throwable)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/mcp/McpConfig.kt:114 — `catch (e: Exception)` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/runconfig/LLMRunConfigAnalyzer.kt:273 — `catch (e: Exception)` 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.
  • + 13 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×34
  • No test reaches this file mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/node-repl/server.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/generate-test-scenario.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-vscode/webview/src/components/nano/NanoActionHandler.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/generate-test-report.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-vscode/webview/src/utils/codeFence.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/analyze-test-results.cjs:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/run-integration-tests.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/publish-remote.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/prepare-node-runtime.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/design-system/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-web/src/services/LLMService.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-vscode/webview/src/types/nano.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/src/jsMain/typescript/processors/ModeCommandProcessor.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-vscode/webview/src/hooks/useVSCode.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/prepare-node-modules.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/scripts/publish-local.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file mpp-ui/webpack.config.d/node-polyfills.js:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 9 more in this group — see findings.md.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×33
  • Outbound HTTP without resilience mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:33 — `HttpClient {` 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:37 — `HttpClient {` 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tracker/GitHubIssueTracker.kt:31 — `HttpClient {` 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/clients/CustomOpenAILLMClient.kt:137 — `HttpClient(` 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 mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt:7 — `HttpClient {` 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 mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.ios.kt:8 — `HttpClient(` 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 mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.js.kt:16 — `HttpClient {` 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 mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.js.kt:17 — `HttpClient(` 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:32 — `HttpClient(` 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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/llm/provider/GithubCopilotClientProvider.kt:72 — `HttpClient(` 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.wasmJs.kt:13 — `HttpClient {` 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 mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/impl/http/HttpClientFactory.wasmJs.kt:14 — `HttpClient(` 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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CustomMcpServerManager.kt:36 — `HttpClient(` 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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:19 — `HttpClient(` 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 mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.ios.kt:8 — `HttpClient {` 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 mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.ios.kt:9 — `HttpClient(` 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 mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.js.kt:6 — `HttpClient {` 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 mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.js.kt:7 — `HttpClient(` 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 mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/nano/ComposeActionHandler.kt:42 — `HttpClient.newBuilder(` 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 mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CosTestCli.kt:51 — `HttpClient(` 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 mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.wasmJs.kt:10 — `HttpClient {` 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 mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.wasmJs.kt:11 — `HttpClient(` 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 xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt:14 — `HttpClient {` 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 xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt:20 — `HttpClient(` 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 xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:39 — `HttpClient {` 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×32
  • Duplicated block (11 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:119 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:119-129 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt: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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:121 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:121-131 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:122-132 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (11 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:306 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:306-316 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:304-314 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (11 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:196 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:196-206 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:185-195 — before extracting anything, compare `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt` and `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:196` 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) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:41 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:41-51 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgePageStateExtractor.kt:30-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:41` 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 (11 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionRequest.kt:35 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionRequest.kt:35-45 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/ShireCodeCompletionRequest.kt:38-48 — 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 (11 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/MarkdownTable.kt:72 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/MarkdownTable.kt:72-82 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:96-106 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/MarkdownTable.kt:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:194 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:194-204 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:176-186 — 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 `mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `null` to `"error" to "Missing sessionId") ) val session = sessionManager.getSession(sessionId) if (session ==` in one and `"error" to "Missing workflowId") ) val metadata = workflowEngine.queryMetadata(workflowId) if (metadata ==` 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 (11 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:63 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:63-73 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt: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.
  • Duplicated block (11 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:117 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:117-127 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:146-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131-141 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131-141 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 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 (11 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451-461 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:589-602 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:716 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:716-726 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:728-738 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:716` 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 (11 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:198 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:198-208 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:361-371 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt: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 (11 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:548 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:548-558 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:572-582 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:548` 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 (11 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:249 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:249-259 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt:194-204 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:249` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt:75 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt:75-85 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt:166-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.
  • Duplicated block (11 lines × 2) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:50 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:50-60 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.wasmJs.kt:71-81 — 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 `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:50` 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:175 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:175-187 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:224-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:175` 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:75 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:75-85 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DomainDictCli.kt:62-72 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:165 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:165-175 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/e2etest/E2ETestAgentDemo.kt:387-397 — 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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:783 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:783-793 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:820-830 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:783` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:148 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:148-158 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:201-211 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:45 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:45-55 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/model/DomainDictionary.kt:147-157 — 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) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/PatchInsCommand.kt:82 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/PatchInsCommand.kt:82-92 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/file/EditFileInsCommand.kt:52-62 — 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.
  • + 7 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×31
  • Sync-over-async blocking mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:51 — `create` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/processor/VelocityExprProcessor.kt:15 — `process` is async and calls runBlocking — a blocking call inside async code stalls the coroutine's thread, and every coroutine dispatched to it for as long as it runs.
  • Sync-over-async blocking example/custom_llm_server/openai_proxy.py:25 — `fetch_chat_completion` is async and calls requests.post — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
  • Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs:259 — `existsSync` in `readActiveExecRegistrySnapshot` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs:628 — `existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking docs/test-scripts/compare-node-repl-codex.mjs:631 — `existsSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:426 — `fs.readFileSync` in `readTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:449 — `fs.existsSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:450 — `fs.mkdirSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:453 — `fs.writeFileSync` in `writeTextFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts:127 — `fs.existsSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts:128 — `fs.mkdirSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts:134 — `fs.existsSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts:135 — `fs.readFileSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/i18n/index.ts:147 — `fs.writeFileSync` in `saveLanguagePreference` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:47 — `fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:57 — `fs.existsSync` in `initialize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:137 — `fs.readFileSync` in `readFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:92 — `fs.readFileSync` in `registerDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:125 — `fs.existsSync` in `runDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:168 — `fs.existsSync` in `runDocument` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:450 — `execSync` in `fetchGitDiff` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:455 — `execSync` in `fetchGitDiff` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:461 — `execSync` in `fetchGitDiff` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking mpp-vscode/src/services/config-manager.ts:121 — `fs.existsSync` in `load` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • + 6 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×30
  • FileTooLong: toolwindow/IdeaComposeIcons.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt — FileTooLong — 1572 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1072 over it, 3.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: node-repl/NodeReplRuntime.ts mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts — FileTooLong — 1360 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 860 over it, 2.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: parser/IndentParser.kt xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt — FileTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 594 over it, 2.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: agent/ComposeRenderer.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt — FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: ComposeRenderer (40-1644). The bar is 500 significant lines; this is 465 over it, 1.93× 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: chatdb/ChatDBExecutor.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt — FileTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: MultiDatabaseChatDBExecutor (41-1152). The bar is 500 significant lines; this is 278 over it, 1.56× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: components/ChatDBStepCard.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt — FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 267 over it, 1.53× 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: codereview/CodeReviewViewModel.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt — FileTooLong — 743 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: CodeReviewViewModel (31-1320). The bar is 500 significant lines; this is 243 over it, 1.49× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: providers/chat-view.ts mpp-vscode/src/providers/chat-view.ts — FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ChatViewProvider (24-1237). The bar is 500 significant lines; this is 235 over it, 1.47× 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: llm/JsExports.kt mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt — FileTooLong — 699 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 199 over it, 1.40× 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: knowledge/IdeaKnowledgeContent.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt — FileTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 174 over it, 1.35× 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: nano/NanoRenderer.tsx mpp-vscode/webview/src/components/nano/NanoRenderer.tsx — FileTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 174 over it, 1.35× 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: editor/IdeaMcpConfigDialog.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt — FileTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 163 over it, 1.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: config/ToolConfigDialog.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt — 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/CodeReviewAgentTemplate.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgentTemplate.kt — FileTooLong — 645 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 145 over it, 1.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: renderer/JewelRenderer.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt — FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: JewelRenderer (42-1062). The bar is 500 significant lines; this is 126 over it, 1.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: render/HtmlRenderer.kt xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/HtmlRenderer.kt — FileTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: HtmlRenderer (14-896). The bar is 500 significant lines; this is 122 over it, 1.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: compose/AutoDevApp.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt — FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 108 over it, 1.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: artifact/ArtifactPreviewPanel.jvm.kt mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt — FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 90 over it, 1.18× 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: editor/DevInEditorInput.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt — FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 83 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: agent/AgentMessageList.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt — FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 80 over it, 1.16× 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: evaluator/NanoExpressionEvaluator.kt xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt — FileTooLong — 573 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 73 over it, 1.15× 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: jvm/JvmCodeParser.kt mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt — FileTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 67 over it, 1.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: webedit/WebEditPage.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt — FileTooLong — 559 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 59 over it, 1.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: agent/CodingAgentPage.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt — FileTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 56 over it, 1.11× 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: acp/AcpClient.kt mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt — FileTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AcpClient (37-906). The bar is 500 significant lines; this is 47 over it, 1.09× 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.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×30
  • Duplicated block (12 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:73 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:73-84 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:113-124 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:73` 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) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:90 — mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:90-101 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:90-101 — before extracting anything, compare `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` and `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 94 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 (12 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:289 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:289-300 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:287-298 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (12 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:22 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:22-33 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:44-55 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:22` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:84 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:84-95 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:114-125 — 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 (12 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:40 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:40-51 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/ChatBaseIntention.kt:41-52 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/ChatBaseIntention.kt` as WHOLE FILES: 94% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (12 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotDetector.kt:42 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotDetector.kt:42-53 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotProvider.kt:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:248 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:248-259 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:368-379 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:248` 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) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ClaudeSkillCommandCompletion.kt:40 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ClaudeSkillCommandCompletion.kt:40-51 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/SpecKitCommandCompletion.kt:41-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:24 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:24-35 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/SpringGradleContextProvider.kt:144-155 — 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 `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:24` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:49 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:49-60 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:47-58 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `viewModel` to `IdeaKnowledgeViewModel` in one and `IdeaWebEditViewModel` 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 (12 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:584 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:584-595 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:605-616 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:584` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:36 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:36-47 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:36-47 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 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 (12 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:146 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:146-157 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:303-314 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:146` 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 (12 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:215 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:215-226 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:416-427 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:215` 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 (12 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:96 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:96-107 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt:131-142 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:96` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:240 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:240-251 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:284-295 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:240` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:190 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:190-201 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:352-363 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:190` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:224 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:224-235 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:261-272 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:224` 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 (12 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:182 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:182-193 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:359-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:182` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:146 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:146-157 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt:53-64 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayRenderer.kt:11 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayRenderer.kt:11-22 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayRenderer.kt:11-22 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayRenderer.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayRenderer.kt` as WHOLE FILES: 92% 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. 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:35 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:35-46 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt:34-45 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:19 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:19-30 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:23-34 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:32 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:32-43 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:36-47 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 5 more in this group — see findings.md.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×27
  • Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html:101 — `.rocket` moves (`animation: rocket-fly 2.5s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html:134 — `.fire-trail` moves (`animation: fire-flicker 0.1s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html:167 — `.energy-burst` moves (`animation: burst 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html:204 — `.spark` moves (`animation: spark 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-ui/src/wasmJsMain/resources/index.html:292 — `.progress-bar` moves (`transition: width 0.3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-viewer-web/src/commonMain/resources/mermaid.html:46 — `.mermaid` moves (`transition: transform 0.2s ease-in-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-viewer-web/src/commonMain/resources/viewer.html:45 — `.spinner` moves (`animation: spin 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-web/index.html:101 — `.rocket` moves (`animation: rocket-fly 2.5s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-web/index.html:134 — `.fire-trail` moves (`animation: fire-flicker 0.1s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-web/index.html:167 — `.energy-burst` moves (`animation: burst 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-web/index.html:204 — `.spark` moves (`animation: spark 2.5s ease-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-web/src/index.css:142 — `.xu-btn` moves (`transition: transform 120ms ease, background 120ms ease, border-color 120ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/App.css:44 — `.status-dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/App.css:129 — `.loading-spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/MessageList.css:61 — `.message` moves (`animation: fadeIn 0.2s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/MessageList.css:118 — `.streaming-indicator .dot` moves (`animation: pulse 1.4s infinite ease-in-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/ModelSelector.css:39 — `.dropdown-arrow` moves (`transition: transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/Timeline.css:71 — `.streaming-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.css:86 — `.code-streaming-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.css:60 — `.nanodsl-loading .spinner` moves (`animation: spin 0.8s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/SketchRenderer.css:27 — `.loading-indicator .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/TerminalRenderer.css:123 — `.terminal-running .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/sketch/ThinkingRenderer.css:50 — `.thinking-streaming .dot` moves (`animation: pulse 1.4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:66 — `.status-icon.in-progress` moves (`animation: spin 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard mpp-vscode/webview/src/components/plan/PlanSummaryBar.css:81 — `.expand-arrow` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×27
  • Duplicated block (13 lines × 2) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:293 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:293-305 | mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:346-358 — both copies are in the same file, so extract the 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 `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:293` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:92 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:92-104 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:132-144 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt: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.
  • Duplicated block (13 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:277 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:277-289 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:366-378 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:277` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:401 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:401-413 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:472-484 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:331 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:331-343 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:329-341 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (13 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:706 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:706-718 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:721-733 — both copies are in the same file, so extract the 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) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpEventCapture.kt:214 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpEventCapture.kt:214-226 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/AcpCaptureCli.kt:289-301 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:104 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:104-116 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:101-113 — before extracting anything, compare `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt` and `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:104` 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 (13 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:95 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:95-107 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:122-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:149 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:149-161 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:331-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt: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 (13 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:87 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:87-99 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:77-89 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:87` 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 (13 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt:23 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt:23-35 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/InsertUtil.kt:22-34 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/InsertUtil.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaBottomToolbar.kt:49 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaBottomToolbar.kt:49-61 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/BottomToolbar.kt:53-65 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaBottomToolbar.kt: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 (13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:330 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:330-342 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt:323-335 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:330` 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 (13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:564 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:564-576 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:703-715 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:564` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:147 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:147-159 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:175-187 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:147` 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, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:160` calls `Column`, `spacedBy` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaNanoDSLBlockRenderer.kt:188` 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 (13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:41 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:41-53 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:77-89 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:50 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:50-62 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentContent.kt:50-62 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:50` 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) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:132 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:132-144 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:160-172 — both copies are in the same file, so extract the 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:300 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:300-312 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:521-533 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:300` 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 (13 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:87 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:87-99 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:181-193 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:87` 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 (13 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:153 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:153-165 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt:175-187 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:37 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:37-49 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:56-68 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.ios.kt:41 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.ios.kt:41-53 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.ios.kt:55-67 — 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 `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.ios.kt:41` 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) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:39 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:39-51 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.wasmJs.kt:30-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:39` 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, `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:37` calls `mutableStateOf` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.wasmJs.kt:29` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×27
  • Duplicated block (9 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:77 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:77-85 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/model/DomainDictionary.kt:179-187 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:77` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:137 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:137-145 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:317-325 — 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:137` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:231 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:231-239 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt: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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:231` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt:65 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt:65-73 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt:81-89 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt:74` calls `onCodeChange` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffRepair.kt:90` 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) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/util/SQLExecutor.kt:116 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/util/SQLExecutor.kt:116-124 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/util/SQLExecutor.kt:135-143 — both copies are in the same file, so extract the 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:42 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:42-50 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:139-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:138` calls `stringProp` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:41` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelInputComponents.kt:343 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelInputComponents.kt:343-351 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:327-335 — 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 (9 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:168 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:168-176 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:140-148 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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 (9 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:259 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:259-267 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:273-281 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:259` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:268` calls `onUndoCallback`, `close` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:282` 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 (9 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:40 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:40-48 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:83-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:82` calls `stringProp` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:39` 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) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:57 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:57-65 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:84-92 — both copies are in the same file, so extract the 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 `xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt: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. 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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:542 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:542-550 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:611-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:78 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:78-86 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:45-53 — before extracting anything, compare `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt` and `mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:103 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:103-111 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:103-111 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 141 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:103` 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:79 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:79-87 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt:78-86 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/scoring/FileWeightCalculator.kt:61 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/scoring/FileWeightCalculator.kt:61-69 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:101-109 — 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 (9 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:40 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:40-48 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:126-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.
  • Duplicated block (9 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/provider/DevInsPromptProcessor.kt:105 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/provider/DevInsPromptProcessor.kt:105-113 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/flow/DevInsProcessProcessor.kt:144-152 — 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt:80 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt:80-88 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/OmnibarItem.kt:80-88 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/OmnibarItem.kt` as WHOLE FILES: 99% 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. 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:142 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:142-150 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:142-150 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:74 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:74-82 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.jvm.kt:74-82 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.jvm.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:56 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:56-64 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:56-64 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:120 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:120-128 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:120-128 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:165 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:165-173 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:165-173 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:323 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:323-331 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:643-652 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×25
  • Duplicated block (10 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:164 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:164-173 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:197-206 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:164` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:172 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:172-181 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:193-202 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:172` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/DocumentReranker.kt:128 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/DocumentReranker.kt:128-137 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/DocumentReranker.kt:161-170 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/DocumentReranker.kt:128` 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 (10 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:22 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:22-31 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/variable/VariableTable.kt:9-18 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:22` 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) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:216 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:216-225 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:214-223 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:216` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:52 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:52-61 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt:55-64 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt` as WHOLE FILES: 82% 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.
  • Duplicated block (10 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffStrategy.kt:24 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffStrategy.kt:24-33 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffStrategy.kt:79-88 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffStrategy.kt:20` calls `generateSummary` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffStrategy.kt:78` 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 (10 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/LaunchProcessInsCommand.kt:173 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/LaunchProcessInsCommand.kt:173-182 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/LaunchProcessInsCommand.kt:229-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/LaunchProcessInsCommand.kt:173` 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 (10 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:132 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:132-141 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:287-297 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/Tool.kt:42 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/Tool.kt:42-51 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/AgentTool.kt:16-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:146 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:146-155 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/VariableProcessor.kt:178-187 — 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt:50 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt:50-59 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/InsertUtil.kt:49-58 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/InsertUtil.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/InsertUtil.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:181 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:181-190 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:153-162 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:110 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:110-119 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:135-144 — 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 (10 lines × 2) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:117 — mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:117-126 | mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.wasmJs.kt:106-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.
  • Duplicated block (10 lines × 2) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:133 — mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:133-142 | mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.wasmJs.kt:122-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:166 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:166-177 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:188-197 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:166` 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 (10 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:323 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:323-333 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:361-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:323` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:485 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:485-494 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:586-596 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:485` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:480 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:480-489 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt:751-761 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:480` 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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:482 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:482-491 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:497-506 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:482` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:281 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:281-290 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/NavLayout.kt:306-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:202 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:202-211 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:594-603 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:202` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:346 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:346-355 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:404-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:346` 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 (10 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt:33 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt:33-42 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:26-35 — 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 `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×24
  • Duplicated block (14 lines × 2) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:307 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:307-320 | mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:360-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:307` 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 (14 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:55 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:55-69 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:167-180 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:55` 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 (14 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:76 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:76-89 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:183-196 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `params` to `ReadProcessParams` in one and `WaitProcessParams` 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 (14 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ShellTool.kt:196 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ShellTool.kt:196-209 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ShellTool.kt:234-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/naming/LanguageSuffixRules.kt:22 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/naming/LanguageSuffixRules.kt:22-35 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/naming/LanguageSuffixRules.kt:22-35 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/naming/LanguageSuffixRules.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/naming/LanguageSuffixRules.kt` as WHOLE FILES: 96% 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.
  • Duplicated block (14 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:683 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:683-696 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:659-672 — 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 `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:683` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:103 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:103-116 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:93-106 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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 (14 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpChatResultPanel.kt:184 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpChatResultPanel.kt:184-197 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpChatResultPanel.kt:327-340 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpChatResultPanel.kt:184` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/LivingDocumentation.kt:49 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/LivingDocumentation.kt:49-62 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/ParseCommentProcessor.kt:28-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (14 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/CustomAgentCompletion.kt:29 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/CustomAgentCompletion.kt:29-42 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/CustomAgentCompletion.kt:52-65 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/CustomAgentCompletion.kt:29` 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) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt:23 — mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt:23-36 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt:39-52 — both copies are in the same file, so extract the 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 (14 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:358 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:358-371 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:485-498 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:358` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:377` calls `info` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:504` 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 (14 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:529 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:529-542 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:560-573 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:529` 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, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:526` calls `Divider`, `fillMaxWidth`, `height` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:557` 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 (14 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:193 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:193-206 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:380-393 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:193` 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) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:71 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:71-84 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:92-105 — both copies are in the same file, so extract the 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 `mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:91` calls `setLong` and `mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:70` 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 (14 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:759 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:759-772 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:842-855 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:759` 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, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:857` calls `clear` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:773` 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 (14 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DiffSketchRenderer.kt:429 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DiffSketchRenderer.kt:429-442 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DiffSketchRenderer.kt:444-457 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DiffSketchRenderer.kt: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 (14 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt:19 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt:19-32 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.jvm.html.kt:7-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. 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 (14 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:467 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:467-480 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:494-508 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:467` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:206 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:206-219 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:273-286 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:206` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:224 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:224-237 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:368-381 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:224` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:83 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:83-96 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:64-77 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:83` 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 (14 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:96 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:96-109 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt:119-132 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:96` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:232 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:232-245 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListPanel.kt:197-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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:232` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×20
  • Duplicated block (8 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/NameMatchScorer.kt:63 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/NameMatchScorer.kt:63-71 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/NameMatchScorer.kt:97-104 — both copies are in the same file, so extract the 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:92 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:92-99 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:93-100 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (8 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:454 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:454-461 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:465-472 — both copies are in the same file, so extract the 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 `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:225 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:225-232 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:191-198 — 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:148 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:148-155 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:42-49 — 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:410 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:410-417 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:502-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:410` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225-232 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:302-309 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:300 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:300-307 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:335-342 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:300` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:225 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:225-232 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:243-250 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:225` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:72 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:72-79 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:93-101 — both copies are in the same file, so extract the 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt: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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:48 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:48-55 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt:47-54 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:70 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:70-77 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:73-80 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:160 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:160-167 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:213-220 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:104 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:104-113 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt:21-28 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffContextCompressor.kt:289 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffContextCompressor.kt:289-296 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/FilePriorityCalculator.kt:160-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:320 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:320-327 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/ShellEnvironmentUtils.kt:73-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskSectionPanel.kt:216 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskSectionPanel.kt:216-223 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskStepPanel.kt:366-373 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.android.kt:5 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.android.kt:5-12 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.jvm.kt:5-12 — 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:389 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:389-396 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:453-460 — both copies are in the same file, so extract the 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:389` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/MarkdownlintLinter.kt:27 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/MarkdownlintLinter.kt:27-34 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PylintLinter.kt:26-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/MarkdownlintLinter.kt:27` 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 (16 lines × 2) · ×19
  • Duplicated block (16 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:58 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:58-73 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt:57-72 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 (16 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:184 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:184-199 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:206-221 — both copies are in the same file, so extract the 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 (16 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:652 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:652-667 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:353-368 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:652` 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 (16 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:361 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:361-376 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:429-444 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/tasks/FileGenerateTask.kt:77 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/tasks/FileGenerateTask.kt:77-92 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/ShireFileGenerateTask.kt:85-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. 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 (16 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/CopyAllMessagesAction.kt:24 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/CopyAllMessagesAction.kt:24-39 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/SummaryMessagesAction.kt:107-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:383 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:383-398 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:402-417 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:383` 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 (16 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:260 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:260-275 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:314-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:260` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:778 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:778-793 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentViewModel.kt:667-683 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:778` 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 (16 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:511 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:511-526 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:518-533 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:511` 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 (16 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:751 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:751-766 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:779-794 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:751` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:421 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:421-436 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:400-415 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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 (16 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:67 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:67-82 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:62-77 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:84` calls `mutableStateOf` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:79` 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:89 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:89-104 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt:90-105 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 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 (16 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:713 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:713-728 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:775-790 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:713` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:536 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:536-551 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:424-439 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:536` 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) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:32 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:32-47 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:32-47 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:32` 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:129 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:129-144 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.wasmJs.kt:84-99 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:129` 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 (16 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:169 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:169-184 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:341-356 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:166` calls `fillMaxHeight` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:338` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D35 · Change Coupling · Change coupling · ×18
  • Change coupling: chat-view.ts ↔ useVSCode.ts mpp-vscode/src/providers/chat-view.ts:1 — `mpp-vscode/src/providers/chat-view.ts` and `mpp-vscode/webview/src/hooks/useVSCode.ts` change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `2a5de665` feat(vscode): implement plan functionality for mpp-vscode; `277e397d` fix(mpp-vscode): fix VSCode API acquisition for webview communication; `6b56e8ad` feat(mpp-vscode): add ModelSelector and unified toolbar layout — run `git show` on any of them.
  • Change coupling: chat-view.ts ↔ App.tsx mpp-vscode/src/providers/chat-view.ts:1 — `mpp-vscode/src/providers/chat-view.ts` and `mpp-vscode/webview/src/App.tsx` change together 71% of the time (12 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `18e7818a` fix: Address PR review comments and fix build errors; `b34a64d4` feat(mpp-vscode): implement CodeLens with Tree-sitter and fix CodeFen…; `bce4dfc1` fix: address PR #40 review comments — run `git show` on any of them.
  • Change coupling: AutoDevInputSection.kt ↔ RelatedFileListCellRenderer.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/RelatedFileListCellRenderer.kt` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `eafa1331` refactor(gui): improve file presentation and update related UI compon… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt` and `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/RelatedFileListCellRenderer.kt`); `e684c68c` refactor(gui): extract FilePresentation into separate class #358 (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt` and `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/RelatedFileListCellRenderer.kt`); `bad095f7` feat(gui): add clear all button and improve file display in AutoDev i… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInputSection.kt` and `core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/RelatedFileListCellRenderer.kt`) — run `git show` on any of them.
  • Change coupling: ToolOrchestrator.kt ↔ ToolCallParser.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/ToolCallParser.kt` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c2e3c024` feat(document): add ProductFeatureTreeAgent for automatic feature tre…; `4167e8b3` refactor(agent): update tool config and orchestration logic #453; `a4c56f77` feat(tool): add WebFetch tool orchestration and tests #453 — run `git show` on any of them.
  • Change coupling: ChatWithThisAction.kt ↔ NewChatWithCodeBaseIntention.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/ChatWithThisAction.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/ChatWithThisAction.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/NewChatWithCodeBaseIntention.kt` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `c4d23328` refactor(intentions): move ElementSelectionUtils to ElementSelectionF… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/actions/chat/ChatWithThisAction.kt` and `core/src/main/kotlin/cc/unitmesh/devti/intentions/action/NewChatWithCodeBaseIntention.kt`); `f08f12ad` refactor: Add the right-click actions to the dynamic group and check … (at that commit the files were still `src/main/kotlin/cc/unitmesh/devti/actions/chat/ChatWithThisAction.kt` and `src/main/kotlin/cc/unitmesh/devti/intentions/action/NewChatWithCodeBaseIntention.kt`); `8cc587ac` refactor: simplify code (at that commit the files were still `src/main/kotlin/cc/unitmesh/devti/actions/chat/ChatWithThisAction.kt` and `src/main/kotlin/cc/unitmesh/devti/intentions/action/NewChatWithCodeIntention.kt`) — run `git show` on any of them.
  • Change coupling: ComponentViewFunctionProvider.kt ↔ ContainerViewFunctionProvider.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ComponentViewFunctionProvider.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ComponentViewFunctionProvider.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ContainerViewFunctionProvider.kt` 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `daf5ba2a` refactor(devti): convert ToolchainFunctionProvider methods to suspend… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ComponentViewFunctionProvider.kt` and `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ContainerViewFunctionProvider.kt`); `5b955c37` feat(mcp): enhance MCP tool execution and documentation #330 (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ComponentViewFunctionProvider.kt` and `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ContainerViewFunctionProvider.kt`); `6bbed837` feat(toolchain): add `funcNames` method to `ToolchainFunctionProvider… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ComponentViewFunctionProvider.kt` and `core/src/main/kotlin/cc/unitmesh/devti/bridge/archview/ContainerViewFunctionProvider.kt`) — run `git show` on any of them.
  • Change coupling: RipgrepSearcher.kt ↔ RipgrepSearchInsCommand.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/RipgrepSearchInsCommand.kt` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8a917d8c` feat(search): limit ripgrep results and improve formatting (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/RipgrepSearchInsCommand.kt`); `0afdd8f8` feat(search): display total results in search output (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/agenttool/search/RipgrepSearcher.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/RipgrepSearchInsCommand.kt`); `41357c58` fix(ripgrep): handle binary lookup exceptions gracefully (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/agenttool/search/RipgrepSearcher.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/RipgrepSearchInsCommand.kt`) — run `git show` on any of them.
  • Change coupling: MarkdownPlanParser.kt ↔ PlanSketchProvider.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/PlanSketchProvider.kt` change together 57% of the time (13 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `68e891de` refactor(plan): rename AgentPlan to AgentTaskEntry and PlanTask to Ag… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/ThoughtPlanSketchProvider.kt`); `a0221405` fix(task-status): update task status logic for TODO and COMPLETED #331 (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/ThoughtPlanSketchProvider.kt`); `b1cbc714` refactor(plan): rename onDoneStream to onComplete and update UI handl… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/ThoughtPlanSketchProvider.kt`) — run `git show` on any of them.
  • Change coupling: AgentMessageList.kt ↔ ToolItem.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolItem.kt` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `65fb9587` feat: enhance error display with expandable notices and clipboard copy; `5b2beda6` refactor(ui): replace Card with Surface in agent components #453; `b309b49e` refactor(ui): replace status text with icons in agent views #453 — run `git show` on any of them.
  • Change coupling: ArtifactPage.kt ↔ ArtifactPreviewPanel.jvm.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPage.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPage.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `3d3be42c` feat: Add artifact-specific UI components with compact code display a…; `f1856feb` feat: Add ProcessManager for long-running artifact execution with sta…; `7d8d8c6e` fix(artifact): improve export and load-back support — run `git show` on any of them.
  • Change coupling: CodingAgentRenderer.kt ↔ RendererModels.kt mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/CodingAgentRenderer.kt:1 — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/CodingAgentRenderer.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/RendererModels.kt` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `99037b0b` feat(renderer): refactor agent and database rendering logic #508; `017ddfea` feat(chatdb): refactor multi-database agent and renderer #508; `755db21d` feat(chatdb): add multi-database chat agent support #508 — run `git show` on any of them.
  • Change coupling: IdeaTimelineContent.kt ↔ IdeaKnowledgeContent.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt:1 — `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `cbda026f` feat(acp): enhance ContentBlock handling and add ThinkingItem UI #536; `a617a0d1` feat(idea): add vision analysis timeline item display; `99037b0b` feat(renderer): refactor agent and database rendering logic #508 — run `git show` on any of them.
  • Change coupling: IdeaAgentApp.kt ↔ IdeaComposeIcons.kt mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt:1 — `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaComposeIcons.kt` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `c1ddc84d` feat(idea): add WebEdit tool window integration #511; `0224779f` fix(mpp-idea): fix folder selection and improve search UI; `593d4ca2` feat(mpp-idea): add top toolbar with @ trigger and file selection — run `git show` on any of them.
  • Change coupling: CodeReviewViewModel.kt ↔ DiffCenterView.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:1 — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `cfb1ca62` feat(codereview): add issue cache with refresh and age display #463; `24f694fc` refactor(codereview): remove unused code content cache #463; `f1f9d40d` feat(codereview): add multi-select and range diff for commits #463 — run `git show` on any of them.
  • Change coupling: SketchToolWindow.kt ↔ EditorFragment.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorFragment.kt` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9f403297` fix(sketch): update UI elements and text handling (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorFragment.kt`); `ce38ebd2` refactor(devti): improve sketch UI and remove unused features (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorFragment.kt`); `c07eee80` feat(editor): add preview editor support to EditorFragment (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt` and `core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code/EditorFragment.kt`) — run `git show` on any of them.
  • Change coupling: GenerateDockerfileAction.kt ↔ GenerateGitHubActionsAction.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/GenerateDockerfileAction.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/GenerateDockerfileAction.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/GenerateGitHubActionsAction.kt` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `cbf0d5a6` refactor(actions): update package and import paths (at that commit the files were still `src/main/kotlin/cc/unitmesh/devti/actions/GenerateDockerfileAction.kt` and `src/main/kotlin/cc/unitmesh/devti/actions/GenerateGitHubActionsAction.kt`); `6a25cf33` fix: make output in file better (at that commit the files were still `src/main/kotlin/cc/unitmesh/genius/actions/GenerateDockerfileAction.kt` and `src/main/kotlin/cc/unitmesh/genius/actions/GenerateGitHubActionsAction.kt`); `bcb86750` refactor: extract code-review template (at that commit the files were still `src/main/kotlin/cc/unitmesh/genius/actions/GenerateDockerfileAction.kt` and `src/main/kotlin/cc/unitmesh/genius/actions/GenerateGitHubActionsAction.kt`) — run `git show` on any of them.
  • Change coupling: JavaVersionProvider.kt ↔ KotlinVersionProvider.kt mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt:1 — `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt` and `mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinVersionProvider.kt` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `1f85cc80` refactor(context): suspend collect function for better async handling… (at that commit the files were still `java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt` and `kotlin/src/233/main/kotlin/cc/unitmesh/kotlin/provider/KotlinVersionProvider.kt`); `72a697f5` refactor(providers): remove suspend keyword from collect methods #306 (at that commit the files were still `java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt` and `kotlin/src/233/main/kotlin/cc/unitmesh/kotlin/provider/KotlinVersionProvider.kt`); `5164da09` feat: init basic js context provider (at that commit the files were still `java/src/main/kotlin/cc/unitmesh/idea/provider/JavaVersionProvider.kt` and `kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinVersionProvider.kt`) — run `git show` on any of them.
  • Change coupling: McpFunctionProvider.kt ↔ ToolchainCommandCompletion.kt mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/McpFunctionProvider.kt:1 — `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/McpFunctionProvider.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ToolchainCommandCompletion.kt` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `706a47fb` feat(devti): add MCP group support and refactor toolchain functions (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/mcp/client/McpFunctionProvider.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ToolchainCommandCompletion.kt`); `4b19877d` feat(core): add mock data generation for MCP tooltips (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/mcp/client/McpFunctionProvider.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ToolchainCommandCompletion.kt`); `38abbf77` feat(core): add completion support for MCP tools and refactor related… (at that commit the files were still `core/src/main/kotlin/cc/unitmesh/devti/mcp/client/McpFunctionProvider.kt` and `exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/ToolchainCommandCompletion.kt`) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×18
  • Duplicated block (15 lines × 2) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:46 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:46-60 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:51-65 — before extracting anything, compare `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt: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. 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:42 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:42-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:54-68 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:163 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:163-177 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:337-351 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:163` 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 after the matched lines, `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:353` calls `calculateCohesion`, `calculateCoupling` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:179` 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) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt:195 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt:195-209 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:296-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt: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. 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/ElementSelectionForChat.kt:45 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/ElementSelectionForChat.kt:45-59 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/select/DefaultPsiElementStrategy.kt:53-67 — 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:348 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:348-362 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:410-424 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:348` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:883 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:883-897 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1021-1035 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:883` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:77 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:77-91 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:51-65 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:77` 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, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:47` calls `LaunchedEffect`, `animateScrollTo` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:75` 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 (15 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:589 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:589-603 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:715-729 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:589` 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 (15 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:711 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:711-725 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/pr/InlinePRComment.kt:102-116 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:711` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:301 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:301-315 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:370-384 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:301` 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 (15 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:60 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:60-74 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:170-184 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:60` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:62 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:62-76 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:87-101 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:62` 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, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:86` calls `intProp` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:61` 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 (15 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:64 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:64-78 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:61-75 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:64` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/ToolchainFunctionProvider.kt:15 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/ToolchainFunctionProvider.kt:15-29 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/toolchain/ToolchainFunctionProvider.kt:8-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/toolchain/ToolchainFunctionProvider.kt:8` 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:257 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:257-271 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:264-278 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 267 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:86 — mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:86-101 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:107-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 `mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:86` 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 (15 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:66 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:66-80 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:67-81 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×18
  • Duplicated block (7 lines × 2) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:24 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:24-30 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:29-35 — before extracting anything, compare `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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 (7 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:58 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:58-64 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:71-77 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:58` 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 (7 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:58 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:58-66 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShireFileEditorWithPreview.kt:79-85 — 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:58` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:25 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:25-31 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:95-101 — both copies are in the same file, so extract the 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:344 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:344-350 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:471-477 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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 (7 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:102 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:102-108 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaTerminalRenderer.kt:93-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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:102` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:184 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:184-190 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:217-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt: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. 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 first that the copies are not typed on the same thing: the declarations holding them bind `data` to `ChartDataContent.ColumnData` in one and `ChartDataContent.RowData` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:192` calls `drawGridLines` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:225` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:362 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:362-368 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentReaderViewModel.kt:455-461 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:362` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/plan/AgentPlan.kt:111 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/plan/AgentPlan.kt:111-117 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/plan/MarkdownPlanParser.kt:115-121 — 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:28 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:28-34 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShireFileEditorWithPreview.kt:55-61 — 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 (7 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:91 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:91-97 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/MultimodalState.kt:86-92 — 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 (7 lines × 2) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:58 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:58-64 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:56-62 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:104 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:104-110 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt:104-110 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:116 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:116-122 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt:116-122 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) xiuper-ui/src/androidMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.android.kt:7 — xiuper-ui/src/androidMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.android.kt:7-13 | xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/prompt/ResourceLoader.jvm.kt:7-13 — 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 (7 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:563 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:563-569 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentViewModel.kt:412-418 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:563` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:58 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:58-64 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:81-87 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:58` 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) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:146 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:146-152 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/config/ToolConfigExports.kt:119-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×16
  • Duplicated block (17 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:88 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:88-104 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:90-106 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:88` 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 (17 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:54 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:54-70 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:80-96 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:54` 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 (17 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:102 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:102-118 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:103-119 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (17 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:56 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:56-72 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:46-62 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:56` 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 (17 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:96 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:96-112 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaSymbolProvider.kt:111-127 — 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 `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:96` 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 (17 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:241 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:241-257 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:308-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:241` 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 (17 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:266 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:266-282 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:280-296 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:266` 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 (17 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:55 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:55-71 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:91-107 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:55` 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 (17 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:303 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:303-319 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:286-302 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:303` 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 (17 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/service/AgentService.kt:61 — mpp-server/src/main/kotlin/cc/unitmesh/server/service/AgentService.kt:61-77 | mpp-server/src/main/kotlin/cc/unitmesh/server/service/AgentService.kt:143-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-server/src/main/kotlin/cc/unitmesh/server/service/AgentService.kt:61` 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 (17 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:119 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:119-135 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:154-170 — both copies are in the same file, so extract the 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 `mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:119` 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 (17 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:506 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:506-522 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:393-409 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:506` 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 (17 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:276 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:276-292 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:316-332 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:276` 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 (17 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:235 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:235-251 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:569-585 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt: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 (17 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/PlatformExports.kt:21 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/PlatformExports.kt:21-37 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/PlatformExports.wasmJs.kt:15-72 — 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 `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/PlatformExports.kt:21` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:16 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:16-32 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.jvm.kt:16-32 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.jvm.kt` as WHOLE FILES: 96% 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×15
  • Duplicated block (5 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CommandResolver.kt:13 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CommandResolver.kt:13-17 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CommandResolver.kt:50-54 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CommandResolver.kt:13` 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 (5 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:41 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:41-45 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaBuildSystemProvider.kt:36-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:127 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:127-131 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaPlanRenderer.kt:96-100 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:106 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:106-110 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:171-177 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:106` 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:111 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:111-115 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:178-182 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:58 — mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:58-62 | xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/config/ConfigLoader.kt:41-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:58` 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) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:131 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:131-135 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:291-295 — both copies are in the same file, so extract the 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 `mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:131` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:316 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:316-320 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:385-389 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:316` 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:125 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:125-130 | mpp-viewer/src/commonMain/kotlin/cc/unitmesh/viewer/LanguageDetector.kt:80-84 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:125` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/compression/CompressionConfig.kt:95 — mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/compression/CompressionConfig.kt:95-99 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:872-876 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:871` calls `JsName` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/compression/CompressionConfig.kt:90` 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 (5 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:75 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:75-79 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:113-122 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:81 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:81-85 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:127-136 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:618 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:618-622 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:681-685 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:618` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:64 — mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:64-68 | xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/config/ConfigLoader.kt:47-51 — 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 `mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:64` 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, `mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:69` calls `printStackTrace` and `xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/config/ConfigLoader.kt:52` 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 (5 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:95 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:95-99 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt:58-62 — 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.
D3 · God Classes · FunctionTooLong · ×14
  • FunctionTooLong: App.WebUiApp mpp-web/src/App.tsx:7 — FunctionTooLong — WebUiApp runs 381 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 281 over it, 3.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: App.App mpp-vscode/webview/src/App.tsx:48 — FunctionTooLong — App runs 322 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 222 over it, 3.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.
  • FunctionTooLong: ModelConfigForm.ModelConfigForm mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:42 — FunctionTooLong — ModelConfigForm runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatInterface.ChatInterface mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:36 — FunctionTooLong — ChatInterface 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: ChatInput.ChatInput mpp-vscode/webview/src/components/ChatInput.tsx:32 — FunctionTooLong — ChatInput runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ModelConfigDialog.ModelConfigDialog mpp-vscode/webview/src/components/ModelConfigDialog.tsx:40 — FunctionTooLong — ModelConfigDialog runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: App.App mpp-ui/src/jsMain/typescript/ui/App.tsx:26 — FunctionTooLong — App runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: LandingPage.LandingPage mpp-web/src/LandingPage.tsx:69 — FunctionTooLong — LandingPage runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: publish-remote.main mpp-ui/scripts/publish-remote.js:44 — FunctionTooLong — main 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.
  • FunctionTooLong: Omnibar.Omnibar mpp-vscode/webview/src/components/Omnibar.tsx:80 — FunctionTooLong — Omnibar runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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: DocumentMode.runDocument mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:106 — FunctionTooLong — runDocument runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ReviewMode.runReview mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:60 — FunctionTooLong — runReview runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.main mpp-ui/src/jsMain/typescript/index.tsx:437 — FunctionTooLong — main runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: WelcomeScreen.WelcomeScreen mpp-ui/src/jsMain/typescript/ui/WelcomeScreen.tsx:19 — FunctionTooLong — WelcomeScreen runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×14
  • Duplicated block (6 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:34 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:34-39 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:152-157 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:34` 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, `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:149` calls `isNotEmpty`, `appendLine` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:178 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:178-183 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:368-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:178` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:77 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:77-82 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:67-72 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:77` 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 (6 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/LineInfo.kt:34 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/LineInfo.kt:34-39 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/model/LineInfo.kt: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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/LineInfo.kt:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:392 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:392-397 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:407-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:392` 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:139 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:139-144 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:189-194 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt` as WHOLE FILES: 89% 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 `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:139` 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) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:50 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:50-55 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:50-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:511 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:511-516 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:526-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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:511` 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:81 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:81-86 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:103-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:167 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:167-172 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:192-197 — both copies are in the same file, so extract the 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 `xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:198` calls `of` and `xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:173` 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 (6 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/ElementTag.kt:167 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/ElementTag.kt:167-172 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditChatInput.kt:292-297 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:281 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.jvm.kt:281-288 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownTableRenderer.kt:312-317 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:435 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:435-440 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:444-449 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:435` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt:191 — mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt:191-196 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:737-742 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:743` calls `isNotBlank` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt:197` 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 · ClassTooLong · ×13
  • ClassTooLong: ComposeRenderer mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:40 — ClassTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded), 49 methods. The bar is 400 significant lines; this is 532 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MultiDatabaseChatDBExecutor mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:41 — ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 340 over it, 1.85× 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: ChatViewProvider mpp-vscode/src/providers/chat-view.ts:24 — ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 331 over it, 1.83× 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: CodeReviewViewModel mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:31 — ClassTooLong — 715 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 315 over it, 1.79× 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: HtmlRenderer xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/HtmlRenderer.kt:14 — ClassTooLong — 619 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 219 over it, 1.55× 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: JewelRenderer mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:42 — ClassTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 193 over it, 1.48× 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: DevInsLexer mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:10 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 142 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ToolOrchestrator mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt:33 — ClassTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 123 over it, 1.31× 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: AcpClient mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:37 — ClassTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 119 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.
  • ClassTooLong: WasmJsCodeParser mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:17 — ClassTooLong — 433 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 33 over it, 1.08× 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: IdeaCodeReviewViewModel mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:54 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IdeaAgentViewModel mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:44 — ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 25 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CodingAgentExecutor mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:38 — ClassTooLong — 412 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 12 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · TooManyMethods · ×12
  • TooManyMethods: NodeReplRuntime mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:68 — TooManyMethods — 105 methods. The bar is 30 methods; this is 75 over it, 3.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ComposeRenderer mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:40 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: DevInsLexer mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:10 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WorkspaceFileSearchPopup mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:37 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: JewelRenderer mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:42 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HtmlRenderer xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/HtmlRenderer.kt:14 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 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.
  • TooManyMethods: NanoIRConverter xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:15 — 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: ChatDBViewModel mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:31 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: IndentParser xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:32 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: ChatViewProvider mpp-vscode/src/providers/chat-view.ts:24 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× 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: IdeaAgentViewModel mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:44 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CodeReviewViewModel mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:31 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×11
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:106 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:106-169 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:32-87 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:35-140 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:111-217 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:32-87 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:88 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:88-101 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:88-101 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:88-101 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:131-144 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:88-101 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:24 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:24-58 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:142-182 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:143-177 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:196-224 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:531-559 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:18 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:18-28 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/database/AutoDevDatabaseAction.kt:19-29 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/external/AutoDevSonarLintAction.kt:18-28 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsLogAction.kt:19-29 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsSingleAction.kt:19-29 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:75 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:75-91 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:68-84 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:68-84 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:68-84 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:68-84 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:301 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:301-318 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:211-229 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:211-229 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:211-229 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:211-229 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:320 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:320-334 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:231-247 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:231-247 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:231-247 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:231-247 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:18 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:18-29 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:20-31 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.js.kt:18-29 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:18-29 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:18-29 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:31 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:31-43 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:33-45 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.js.kt:31-43 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:31-43 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:31-43 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:130 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:130-141 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:131-144 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:134-147 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:130-141 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131-144 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:31 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:31-119 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:314-487 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:497-629 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:90-233 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt:39-183 — 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 (18 lines × 2) · ×11
  • Duplicated block (18 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:75 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:75-92 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/ShellBasedLinter.kt:66-83 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:75` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:425 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:425-442 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:115-132 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:425` 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:183 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:183-200 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:131-148 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:203 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:203-220 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:151-168 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:203` 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 (18 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:168 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:168-185 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:358-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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:168` 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) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:85 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:85-102 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/NpmVersionProvider.kt:43-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. 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) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/psi/PsiErrorCollector.kt:85 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/psi/PsiErrorCollector.kt:85-102 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:209-226 — 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 (18 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:899 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:899-916 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1043-1060 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:899` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:28 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:28-45 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:44-61 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:90 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:90-107 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.kt:66-83 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:90` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:86` calls `isSuccess`, `RemoteAgentException` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.kt:64` 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 (18 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:48 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:48-65 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:49-66 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:48` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
  • Members sharing a duplicated core (4 members, 50+ identical tokens) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:22 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:22-47 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:22-47 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:22-47 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:22-47 — 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) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:113 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:113-166 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:103-156 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:113-166 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:103-156 — 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:24 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:24-53 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt:25-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PMDLinter.kt:29-65 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SQLFluffLinter.kt:25-57 — 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) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/MarkdownDocumentParser.kt:44 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/MarkdownDocumentParser.kt:44-56 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/JsoupDocumentParser.kt:75-87 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/PdfDocumentParser.kt:96-108 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/TikaDocumentParser.kt:87-99 — 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) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:103 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:103-130 | mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:135-158 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:103-130 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:135-158 — 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) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:162 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:162-188 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:194-220 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:259-295 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/PythonArtifactExecutor.kt:136-172 — 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:87 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:87-109 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:87-109 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:87-109 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:87-109 — 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:112 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:112-135 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:112-135 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:112-135 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:112-135 — 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:194 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:194-209 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:194-209 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:194-209 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:194-209 — 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) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:274 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:274-289 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:26-81 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:281-296 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:26-81 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×10
  • Low cohesion: CodingCliRenderer (LCOM4 8) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:162 — CodingCliRenderer's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ConsoleRenderer (LCOM4 6) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:509 — ConsoleRenderer's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LLMModelManager (LCOM4 6) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/model/LLMModelManager.kt:31 — LLMModelManager's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ArtifactCliRenderer (LCOM4 5) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:296 — ArtifactCliRenderer's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DefaultFileSystem (LCOM4 5) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.wasmJs.kt:7 — DefaultFileSystem's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: RestSchema (LCOM4 4) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/http/RestFs.kt:166 — RestSchema'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: HobbitHole (LCOM4 4) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/HobbitHole.kt:40 — HobbitHole'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: IdeaFileChangeTracker (LCOM4 4) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeTracker.kt:33 — IdeaFileChangeTracker'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: BaseRenderer (LCOM4 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt:7 — BaseRenderer'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: ParagraphManager (LCOM4 4) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/pdf/config/ParagraphManager.kt:34 — ParagraphManager'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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×9
  • Duplicated block (21 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:22 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:22-42 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:45-65 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:22` 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 after the matched lines, `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:72` calls `augmentEnvironmentPath`, `environment` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:47` 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 (21 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:202 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:202-222 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:203-223 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (21 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:61 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:61-81 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/ComponentInlaysContainer.kt:62-82 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/ComponentInlaysContainer.kt` as WHOLE FILES: 85% 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt: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 (21 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt:58 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt:58-78 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/OmnibarItem.kt:58-78 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/model/OmnibarItem.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/OmnibarItem.kt` as WHOLE FILES: 99% 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. 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 (21 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:194 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:194-214 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:251-271 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:194` 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 (21 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:63 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:63-83 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:75-95 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:63` 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 (21 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:161 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:161-181 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:176-196 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:161` 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 (21 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:388 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:388-408 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:784-804 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:388` 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 (21 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.android.kt:8 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.android.kt:8-28 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.jvm.kt:8-28 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.jvm.kt` as WHOLE FILES: 100% 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. 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 (20 lines × 2) · ×8
  • Duplicated block (20 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:38 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:38-57 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:37-56 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 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 (20 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:60 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:60-79 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:59-78 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 97 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 (20 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:379 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:379-398 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:447-466 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:152 — mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:152-171 | mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:596-615 — both copies are in the same file, so extract the 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:152` 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 (20 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:84 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:84-103 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:97-116 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:522 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:522-541 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:619-638 — both copies are in the same file, so extract the 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, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:521` calls `toggleSessionSidebar` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:618` 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 (20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:167 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:167-186 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:196-215 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:220 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:220-239 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:109-128 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:220` 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) · ×8
  • Duplicated block (19 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:166 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:166-184 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:136-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:392 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:392-410 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:659-677 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:375 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:375-393 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:565-583 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:375` 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 (19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:78 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:78-96 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:87-105 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:592 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:592-610 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:655-673 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:592` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mpp-viewer-web/src/jsMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.js.kt:15 — mpp-viewer-web/src/jsMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.js.kt:15-33 | mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.wasmJs.kt:128-146 — before extracting anything, compare `mpp-viewer-web/src/jsMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.js.kt` and `mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.wasmJs.kt` as WHOLE FILES: 97% 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.
  • Duplicated block (19 lines × 2) xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt:15 — xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt:15-33 | xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.jvm.kt:15-33 — before extracting anything, compare `xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.android.kt` and `xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.jvm.kt` as WHOLE FILES: 100% 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.
  • Duplicated block (19 lines × 2) xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.js.kt:15 — xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.js.kt:15-33 | xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.wasmJs.kt:15-33 — before extracting anything, compare `xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.js.kt` and `xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/http/HttpClientFactory.wasmJs.kt` as WHOLE FILES: 100% 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 (10 lines × 3) · ×8
  • Duplicated block (10 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:35 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:35-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt:38-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SQLFluffLinter.kt:39-48 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:35` 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 (10 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:277 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:277-286 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:366-375 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:661-670 — 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 (10 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:273 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:273-282 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:276-285 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:675-684 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:284 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:284-293 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:222-231 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:259-268 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:284` 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 (10 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:131 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:131-140 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:156-165 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:92-101 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 3) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:11 — mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:11-20 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:11-20 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:11-20 — before extracting anything, compare `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:103 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:103-112 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt:106-115 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:103-112 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:42 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:42-51 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.ios.kt:41-50 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt:41-50 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×7
  • Duplicated block (14–15 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/config/McpToolConfigManager.kt:113 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/config/McpToolConfigManager.kt:113-126 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/config/McpToolConfigManager.kt:246-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:206 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:206-219 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:412-426 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (14–15 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:120 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:120-134 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt:72-85 — 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:116` calls `ChatSession` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt:68` 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 (14–15 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:105 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:105-119 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:148-161 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:146 — mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:146-159 | mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/provider/GitToolchainVariableProvider.kt:127-141 — 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 (14–15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:253 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:253-266 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:82-96 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:299 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:299-312 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:303-317 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:299` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×6
  • Duplicated block (25 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:271 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:271-295 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/PythonArtifactExecutor.kt:148-172 — 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 `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:271` 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 (25 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:261 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:261-285 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:130-154 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:32 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:32-56 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/ComponentInlaysContainer.kt:33-57 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt` and `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/ComponentInlaysContainer.kt` as WHOLE FILES: 85% 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. 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 (25 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:340 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:340-364 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:504-528 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:340` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:83 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:83-107 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:172-196 — both copies are in the same file, so extract the 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:83` 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 (25 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:178 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:178-202 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt:178-202 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:178` 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 × 3) · ×6
  • Duplicated block (13 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:172 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:172-184 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:147-159 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:224-236 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 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 (13 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:139 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:139-151 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:625-637 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:688-700 — 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 (13 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:169 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:169-181 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:139-151 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:297-309 — 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.
  • Duplicated block (13 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:106 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:106-118 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:85-97 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:119-131 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:106` 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 × 3) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:132 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:132-144 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:135-147 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:132-144 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 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 (13 lines × 3) mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:312 — mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:312-324 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:270-282 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:212-224 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` and `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:205` calls `createEmpty`, `AutoDevConfigWrapper`, `ConfigFile` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:264` 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 (7 lines × 3) · ×6
  • Duplicated block (7 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225-231 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:302-308 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:337-343 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:225` 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 × 3) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt:146 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt:146-152 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:123-130 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/DocumentAgentExports.kt:58-64 — 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. 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, `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:116` calls `parseMcpServers` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt:139` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaLivingDocumentation.kt:23 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaLivingDocumentation.kt:23-29 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptLivingDocumentation.kt:34-40 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:69-75 — 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) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:143 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:143-149 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:143-149 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:143-149 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:168 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:168-174 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:171-177 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:168-174 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 3) xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:24 — xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:24-30 | xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.js.kt:23-29 | xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.wasmJs.kt:23-29 — 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.
AC3 · Page structure · Page without a main landmark · ×5
  • Page without a main landmark mpp-idea/mpp-idea-exts/devins-lang/src/main/resources/inspectionDescriptions/DevInsDuplicateAgent.html:1 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark mpp-ui/src/wasmJsMain/resources/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark mpp-viewer-web/src/commonMain/resources/viewer.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark mpp-viewer-web/src/jvmMain/resources/test-shadow-dom.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark mpp-web/index.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×5
  • Duplicated block (32 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:109 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:109-140 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:186-217 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:109` 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 (32 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:920 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:920-951 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1064-1095 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:920` 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 (32 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:20 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:20-51 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:20-51 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 150 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (32 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:54 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:54-85 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt:66-97 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 59 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:54` 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 (32 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1612 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1612-1643 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1694-1725 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1612` 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 (26 lines × 2) · ×5
  • Duplicated block (26 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:174 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:174-199 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:175-200 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (26 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:258 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:258-283 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:256-281 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (26 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:89 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:89-114 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/ChatBaseIntention.kt:78-103 — before extracting anything, compare `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/ChatBaseIntention.kt` as WHOLE FILES: 94% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (26 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:359 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:359-384 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:905-930 — both copies are in the same file, so extract the 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, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:385` calls `Spacer`, `height` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:931` 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 (26 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:69 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:69-94 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:69-94 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:69` 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 (22 lines × 2) · ×5
  • Duplicated block (22 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:80 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:80-101 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt:75-96 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt` as WHOLE FILES: 90% 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 `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:80 — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:80-101 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:83-104 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:165 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:165-186 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:165-186 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt:134 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt:134-155 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt:327-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaTimelineContent.kt:134` 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 (22 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:23 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:23-44 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:24-45 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 55 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:23` 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 × 4) · ×5
  • Duplicated block (15 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:195 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:195-209 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:195-209 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:195-209 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:195-209 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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 (15 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:37 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:37-51 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:27-41 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:40-54 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:27-41 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:37` 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 × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:275 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:275-289 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:66-80 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:282-296 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:66-80 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 4) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:38 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:38-52 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:336-350 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:104-118 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt:46-60 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:38` 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 × 4) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:101 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:101-115 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:62-76 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:200-214 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:122-136 — 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 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt: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.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×5
  • Duplicated block (14 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:131 — mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:131 · mpp-vscode/src/bridge/mpp-core.ts:376 — 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) mpp-ui/src/jsMain/typescript/index.tsx:62 — mpp-ui/src/jsMain/typescript/index.tsx:62 · mpp-ui/src/jsMain/typescript/index.tsx:354 — 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) mpp-ui/src/jsMain/typescript/index.tsx:177 — mpp-ui/src/jsMain/typescript/index.tsx:177 · mpp-ui/src/jsMain/typescript/index.tsx:235 — 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) mpp-vscode/src/services/ide-server.ts:113 — mpp-vscode/src/services/ide-server.ts:113 · mpp-vscode/src/services/ide-server.ts:130 — 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) mpp-web/src/App.tsx:235 — mpp-web/src/App.tsx:235 · mpp-web/src/App.tsx:252 — 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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×4
  • Duplicated block (41 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.js.kt:28 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.js.kt:28-68 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.jvm.kt:28-68 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.js.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.jvm.kt` as WHOLE FILES: 98% 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.
  • Duplicated block (41 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:59 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:59-99 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:136-176 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 113 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (41 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:17 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:17-57 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt:17-57 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt` 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (41 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.js.kt:24 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.js.kt:24-64 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.wasmJs.kt:23-63 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.js.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.wasmJs.kt` as WHOLE FILES: 96% 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 (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:118 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:118-145 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:92-119 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (28 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:78 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:78-105 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:83-110 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 267 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 (28 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:197 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:197-224 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:532-559 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (28 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:39 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:39-66 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:39-66 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:39` 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 (24 lines × 2) · ×4
  • Duplicated block (24 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:316 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:316-339 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:294-317 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:316` 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 (24 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:597 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:597-620 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:618-641 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:597` 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 (24 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.android.kt:24 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.android.kt:24-47 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.ios.kt:24-47 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.ios.kt` as WHOLE FILES: 87% 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.
  • Duplicated block (24 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:466 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:466-489 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:653-676 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:466` 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 (16 lines × 3) · ×4
  • Duplicated block (16 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:173 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:173-188 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt:174-189 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.js.kt:179-194 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 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 (16 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:22 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:22-37 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.ios.kt:21-36 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt:21-36 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 (16 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:34 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:34-49 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:332-347 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:100-115 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:34` 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 (16 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:351 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:351-366 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:380-395 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:409-424 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:351` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/WebArtifactExecutor.kt:124 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/WebArtifactExecutor.kt:124-139 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/WebArtifactExecutor.kt:147-161 — both copies are in the same file, so extract the 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 `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/WebArtifactExecutor.kt:124` 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 (15–16 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:245 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:245-260 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:271-285 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:245` 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 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 (15–16 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:194 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:194-209 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:84-98 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:194` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (15–16 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:44 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:44-58 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:84-99 — 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 `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.js.kt:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×4
  • Duplicated block (15 lines × 3) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:113 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:113-127 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/TypeScriptRefactoringTool.kt:121-135 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinRefactoringTool.kt:103-117 — 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 `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:25 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:25-39 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.ios.kt:25-39 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.jvm.kt:25-39 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.ios.kt` as WHOLE FILES: 96% 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. 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 × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:55 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt:55-69 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.ios.kt:55-69 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.jvm.kt:55-69 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.ios.kt` as WHOLE FILES: 96% 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. 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 × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:101 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:101-115 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:101-115 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:93-107 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt: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 (11 lines × 5) · ×4
  • Duplicated block (11 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:19 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:19-29 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:21-31 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.js.kt:19-29 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:19-29 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:19-29 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 (11 lines × 5) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:350 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:350-360 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:379-389 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:408-418 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:457-467 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:483-493 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:350` 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 (11 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:6 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:6-16 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:8-18 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.js.kt:6-16 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:6-16 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:6-16 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:88 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:88-98 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:89-99 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:92-102 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:88-98 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:89-99 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×4
  • Duplicated block (9 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:105 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:105-113 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:118-126 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:137-145 — 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 `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:105` 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 (9 lines × 3) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:22 — mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:22-30 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:22-30 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:22-30 — before extracting anything, compare `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:32 — xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:32-40 | xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.js.kt:31-39 | xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.wasmJs.kt:31-39 — 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) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt:21 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt:21-29 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:31-39 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/e2etest/E2ETestAgentDemo.kt:43-51 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt: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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×4
  • Duplicated block (8 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131-138 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:132-139 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:135-142 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131-138 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:132-139 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:131` 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 × 5) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:101 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:101-108 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:71-78 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:62-69 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:200-207 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:122-129 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 5) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:30 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:30-37 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/database/AutoDevDatabaseAction.kt:31-38 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/external/AutoDevSonarLintAction.kt:30-37 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsLogAction.kt:31-38 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsSingleAction.kt:31-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:122 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:122-129 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:123-130 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:123-130 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:122-129 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:123-130 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×4
  • Redirected process stream is never drained (deadlock) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:234 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `diffProcess.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `diffProcess.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
  • Redirected process stream is never drained (deadlock) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/linecount/CmdWrapper.kt:100 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
  • Redirected process stream is never drained (deadlock) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:77 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
  • Redirected process stream is never drained (deadlock) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:133 — The JDK pipes both `stdout` and `stderr` of a child started this way — no `redirectErrorStream`, `redirectError`, `redirectOutput` or `inheritIO` is set — and here `process.inputStream` (stdout) is read while the child's end is awaited, but nothing in this scope ever reads `process.errorStream` (stderr). The JDK's own `Process` documentation warns that failing to read a child's output promptly "may cause the process to block, or even deadlock": once the child writes more than the pipe holds to stderr (measured on OpenJDK 25 / Linux: 60,000 bytes finishes, 70,000 hangs forever), it blocks on the write, never exits, and the `waitFor` or end of stream this code waits on never comes. Nothing fails loudly: the thread hangs and the stuck child holds its resources until something kills it. Read both streams (a coroutine or thread per stream), merge them with `redirectErrorStream(true)` before `start()`, or discard the unwanted one with `redirectError(ProcessBuilder.Redirect.DISCARD)` (or `redirectOutput`).
D35 · Change Coupling · Change-coupling hub · ×3
  • Change-coupling hub: RendererExports.kt → DefaultCodingAgentRenderer.kt, BaseRenderer.ts, CliRenderer.ts, TuiRenderer.ts mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt — `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt` changes together with 4 other files — `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt`, `mpp-ui/src/jsMain/typescript/agents/render/BaseRenderer.ts`, `mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts`, `mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
  • Change-coupling hub: InputComponents.kt → ContentComponents.kt, DataComponents.kt, FeedbackComponents.kt, LayoutComponents.kt mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt` changes together with 4 other files — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/content/ContentComponents.kt`, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt`, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt`, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/layout/LayoutComponents.kt` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
  • Change-coupling hub: StatefulNanoRenderer.kt → ContentComponents.kt, DataComponents.kt, FeedbackComponents.kt, NanoRenderer.tsx mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt` changes together with 4 other files — `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/content/ContentComponents.kt`, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt`, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt`, `mpp-vscode/webview/src/components/nano/NanoRenderer.tsx` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×3
  • Duplicated block (34 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:50 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:50-83 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:50-83 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 141 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:50` 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 (34 lines × 2) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:50 — mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:50-83 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:50-83 — before extracting anything, compare `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt` and `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 132 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 (34 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:224 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:224-257 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:213-246 — before extracting anything, compare `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt` and `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:224` 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 (29 lines × 2) · ×3
  • Duplicated block (29 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:71 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:71-99 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:36-64 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (29 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:650 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:650-678 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:807-835 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:650` 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 (29 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:241 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:241-269 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:130-158 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 131 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:241` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:104 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:104-130 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:104-130 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (27 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:95 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:95-121 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:89-115 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:95` 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 (27 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:476 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:476-502 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:549-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotProvider.kt:130 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotProvider.kt:130-152 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/LLMProvider2.kt:429-451 — 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 (23 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:627 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:627-649 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:648-670 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt: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.
  • Duplicated block (23 lines × 2) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:59 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:59-81 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:59-81 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:59` 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 (20 lines × 3) · ×3
  • Duplicated block (20 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:108 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:108-127 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:37-56 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:113-132 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:39 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:39-58 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt:41-60 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:39-58 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:39` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (20 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.android.kt:38 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.android.kt:38-57 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.ios.kt:38-57 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.jvm.kt:38-57 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.android.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/WebViewerHost.ios.kt` as WHOLE FILES: 100% 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 (18 lines × 4) · ×3
  • Duplicated block (18 lines × 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:42 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:42-59 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PylintLinter.kt:40-57 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SwiftLintLinter.kt:39-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt:42-59 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:42` 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 (18 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:146 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:146-163 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:146-163 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:146-163 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:146-163 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:146` 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 × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:174 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:174-191 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:174-191 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:174-191 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:174-191 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:174` 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 (18 lines × 3) · ×3
  • Duplicated block (18 lines × 3) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:453 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:453-470 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:890-907 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:391-408 — before extracting anything, compare `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt` and `mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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 × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:25 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:25-42 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:143-160 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:144-161 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:25` 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 (18 lines × 3) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.ios.kt:49 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.ios.kt:49-66 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:17-34 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt:17-34 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt` 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.ios.kt: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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:33 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:33-49 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:219-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ShellExecutionConfig ): ShellResult = withContext(Dispatchers.IO` in one and `ShellExecutionConfig ): LiveShellSession = withContext(Dispatchers.IO` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:235` calls `setInitialColumns`, `setInitialRows`, `setUnixOpenTtyToPreserveOutputAfterTermination` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:51` 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–17 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:265 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:265-280 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:158-174 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:265` 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–17 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/theme/NanoDesignSystem.kt:50 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/theme/NanoDesignSystem.kt:50-65 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/theme/NanoDesignSystem.kt:68-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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/theme/NanoDesignSystem.kt:50` 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • Duplicated block (14 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:147 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:147-160 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:332-346 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:186-200 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:147` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:143` calls `getDefaultShell` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:327` 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 (14 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:156 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:156-169 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:112-125 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:104-117 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:127` calls `IdeaPlanStatusIcon` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:171` 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 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:292 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:292-305 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:167-180 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:196-209 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:292` 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 (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptLivingDocumentation.kt:72 — mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptLivingDocumentation.kt:72-83 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:136-147 | mpp-idea/mpp-idea-lang/rust/src/main/kotlin/cc/unitmesh/rust/provider/RustLivingDocumentation.kt:50-61 — 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 `mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptLivingDocumentation.kt:72` 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 × 3) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:175 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:175-186 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:254-265 | mpp-server/src/main/kotlin/cc/unitmesh/server/session/SessionManager.kt:112-123 — 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) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:37 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:37-48 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:40-51 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:37-48 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 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 (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:66 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:66-76 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt:68-78 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:66-76 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:98 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:98-108 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:68-78 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:59-69 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:118 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:118-129 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:317-327 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:272-285 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×3
  • Duplicated block (10 lines × 5) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:92 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:92-101 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:92-101 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:92-101 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:135-144 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:92-101 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 98 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:92` 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 (10 lines × 5) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:19 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/console/AutoDevConsoleAction.kt:19-28 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/database/AutoDevDatabaseAction.kt:20-29 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/external/AutoDevSonarLintAction.kt:19-28 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsLogAction.kt:20-29 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/vcs/AutoDevVcsSingleAction.kt:20-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. 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 (10 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:143 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:143-152 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/SessionRepository.ios.kt:146-155 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:149-158 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:143-152 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt:146-155 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/SessionRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:80 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:80-89 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:71-80 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:209-218 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:131-140 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:11 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:11-20 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:11-20 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:11-20 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:11-20 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 4) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:337 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:337-346 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:365-374 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:106-117 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:233-244 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:337` 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 first that the copies are not typed on the same thing: the declarations holding them bind `image` to `IdeaAttachedImage` in one and `AttachedImage` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×3
  • Duplicated block (7 lines × 5) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:107 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:107-113 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:33-39 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:36-42 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:112-118 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:33-39 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:107` 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 × 5) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:88 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:88-94 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:259-265 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:42-48 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:116-122 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:145-151 — 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. 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 first that the copies are not typed on the same thing: the declarations holding them bind `null` to `"error" to "Missing sessionId") ) val session = sessionManager.getSession(sessionId) if (session ==` in one and `"error" to "Missing workflowId") ) val state = workflowEngine.queryState(workflowId) if (state ==` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 5) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:110 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:110-116 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:80-86 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:71-77 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:209-215 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:131-137 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:110` 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.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: Xiuper:mpp-viewer — Xiuper:mpp-viewer: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: Xiuper:mpp-codegraph — Xiuper:mpp-codegraph: abstractness 0.19, instability 0.00, distance 0.81 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: Xiuper:mpp-core — Xiuper:mpp-core: abstractness 0.07, instability 0.17, distance 0.77 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
AC1 · Text alternatives · <canvas> without a text alternative · ×2
  • <canvas> without a text alternative mpp-ui/src/jsMain/resources/index.html:20 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative mpp-ui/src/wasmJsMain/resources/index.html:346 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×2
  • Focus outline removed in CSS without a :focus replacement mpp-vscode/webview/src/components/DevInInput.css:42 — `.devin-textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement mpp-vscode/webview/src/components/Omnibar.css:50 — `.omnibar-input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
D1 · Cyclomatic Complexity · jvmKt.WebEditView (cyclomatic 41) · ×2
  • jvmKt.WebEditView (cyclomatic 41) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • jvmKt.WebEditView (cyclomatic 41) mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NanoDSLValidator.performBasicValidation (cyclomatic 21) · ×2
  • NanoDSLValidator.performBasicValidation (cyclomatic 21) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:35 — NanoDSLValidator.performBasicValidation 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.
  • NanoDSLValidator.performBasicValidation (cyclomatic 21) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:111 — NanoDSLValidator.performBasicValidation 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 · GitOperations.getCommitDiff (cyclomatic 16) · ×2
  • GitOperations.getCommitDiff (cyclomatic 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/platform/GitOperations.kt:48 — GitOperations.getCommitDiff has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • GitOperations.getCommitDiff (cyclomatic 16) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:282 — GitOperations.getCommitDiff has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · jvmKt.WebEditView (cognitive 62) · ×2
  • jvmKt.WebEditView (cognitive 62) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (50 pts), error handling 3 (7 pts), boolean chains 3, match/switch 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • jvmKt.WebEditView (cognitive 62) mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (50 pts), error handling 3 (7 pts), boolean chains 3, match/switch 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoDSLValidator.performBasicValidation (cognitive 29) · ×2
  • NanoDSLValidator.performBasicValidation (cognitive 29) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:35 — NanoDSLValidator.performBasicValidation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • NanoDSLValidator.performBasicValidation (cognitive 29) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:111 — NanoDSLValidator.performBasicValidation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebEditVisionHelperKt.createWebEditVisionHelper (cognitive 23) · ×2
  • WebEditVisionHelperKt.createWebEditVisionHelper (cognitive 23) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditVisionHelper.kt:50 — WebEditVisionHelperKt.createWebEditVisionHelper has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • WebEditVisionHelperKt.createWebEditVisionHelper (cognitive 23) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditVisionHelper.kt:293 — WebEditVisionHelperKt.createWebEditVisionHelper has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · DiffFormatter.postProcess (cognitive 23) · ×2
  • DiffFormatter.postProcess (cognitive 23) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:19 — DiffFormatter.postProcess has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DiffFormatter.postProcess (cognitive 23) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:18 — DiffFormatter.postProcess has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeFence.parseMarkdownContent (cognitive 19) · ×2
  • CodeFence.parseMarkdownContent (cognitive 19) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:150 — CodeFence.parseMarkdownContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
  • CodeFence.parseMarkdownContent (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:202 — CodeFence.parseMarkdownContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (77 shared lines) · ×2
  • Near-duplicate member pair (77 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:45 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:45-140 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:48-186 — These two members are variants of one another: 77 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.
  • Near-duplicate member pair (77 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:45 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:45-140 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:48-186 — These two members are variants of one another: 77 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 (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:31 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:31-65 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:36-74 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:31-65 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:26-81 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:31-65 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:39-79 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:31-65 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:26-81 — These 8 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 8 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 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:138 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:138-163 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:166-191 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:138-163 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:166-191 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:138-163 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:166-191 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:138-163 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:166-191 — These 8 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 8 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 8 times.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×2
  • Duplicated block (52 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:314 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:314-365 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:535-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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:314` 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 (52 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.js.kt:29 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.js.kt:29-80 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.wasmJs.kt:29-80 — 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 `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.js.kt:29` 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 (30–51 lines × 2) · ×2
  • Duplicated block (30–51 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:101 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:101-130 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:119-169 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (30–51 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:101 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:101-130 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:119-169 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:134 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:134-171 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:135-172 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (38 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:173 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:173-210 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:252-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 `mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:173` 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 (28–34 lines × 2) · ×2
  • Duplicated block (28–34 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:60 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:60-87 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:70-103 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:60` 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 (28–34 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:60 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:60-87 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:70-103 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:60` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:215 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:215-245 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:268-298 — both copies are in the same file, so extract the 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:215` 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 (31 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:263 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:263-293 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:266-296 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (28 lines × 3) · ×2
  • Duplicated block (28 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:29 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:29-56 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt:29-56 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.wasmJs.kt:28-55 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:29` 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 (28 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:35 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:35-62 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:51-78 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:32-59 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:35` 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 (25–26 lines × 2) · ×2
  • Duplicated block (25–26 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:29 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:29-53 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt:31-56 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:29` 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 (25–26 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:60 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt:60-84 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt:59-84 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.jvm.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 (25 lines × 3) · ×2
  • Duplicated block (25 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:58 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:58-82 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt:58-82 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.wasmJs.kt:57-81 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:58` 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 (25 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:42 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:42-66 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:108-132 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt:50-74 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:175 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:175-197 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:208-231 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:175` 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 (23–24 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:533 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:533-555 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:602-625 — both copies are in the same file, so extract the 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:533` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:222 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:222-241 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:170-191 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 111 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:222` 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 (20–22 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:541 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:541-560 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.jvm.kt:31-52 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:541` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:539` calls `rememberScrollState` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/FileViewerDialog.jvm.kt:29` 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 (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:81 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:81-102 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:76-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (21–22 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:820 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:820-840 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:913-934 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:820` 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 (18–21 lines × 2) · ×2
  • Duplicated block (18–21 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:166 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:166-183 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:54-74 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:166` 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 (18–21 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451-468 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:777-797 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:451` 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 (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:68 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:68-86 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt: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. 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–19 lines × 2) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:31 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:31-49 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaSymbolProvider.kt:32-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×2
  • Duplicated block (15–18 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:364 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:364-378 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:104-121 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:364` 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 first that the copies are not typed on the same thing: the declarations holding them bind `image` to `IdeaAttachedImage` in one and `AttachedImage` 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 (15–18 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:94 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:94-111 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:157-171 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:94` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×2
  • Duplicated block (17 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:829 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:829-845 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:870-886 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:920-936 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:829` 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, `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:846` calls `switchTo` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:888` 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 (17 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:119 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:119-135 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:210-226 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:150-166 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:119` 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, `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:208` calls `listOf`, `ValidationError` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:117` 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 (9–15 lines × 2) · ×2
  • Duplicated block (9–15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:132 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:132-140 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:172-186 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:132` 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 (9–15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:132 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:132-140 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:172-186 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:132` 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 (12–14 lines × 3) · ×2
  • Duplicated block (12–14 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:40 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:40-51 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:422-435 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:112-125 — 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–14 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:59 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:59-70 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:136-149 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:226-239 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:71` calls `removeChange` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:150` 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 (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:174 — mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:174-185 | mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/provider/GitToolchainVariableProvider.kt:156-169 — 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 (12–14 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:761 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:761-772 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:1224-1237 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:761` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–13 lines × 2) · ×2
  • Duplicated block (8–13 lines × 2) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:217 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:217-229 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:164-171 — before extracting anything, compare `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8–13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:134 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:134-141 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:206-218 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:134` 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 (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:94 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:94-102 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:148-157 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:94` 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 (9–10 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt:25 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt:25-34 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/e2etest/E2ETestAgentDemo.kt:47-55 — 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 `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/kcef/MermaidWebViewPreview.kt:25` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:34 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:34-41 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt:37-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PMDLinter.kt:46-53 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt:34` 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 × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:345 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:345-353 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:403-411 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImagePreviewDialog.kt:98-105 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:345` 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 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 (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:40 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:40-47 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:158-164 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:40` 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–8 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotProvider.kt:114 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/GithubCopilotProvider.kt:114-120 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/LLMProvider2.kt:417-424 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:138 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:138-142 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:184-188 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:217-221 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:138` 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, `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:192` calls `drawGridLines` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:225` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/knowledge/HistoryFunctionProvider.kt:37 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/knowledge/HistoryFunctionProvider.kt:37-41 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/ProjectFileUtil.kt:39-43 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/utils/ProjectFileUtil.kt:12-16 — 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.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×2
  • Duplicated block (17 lines × 2 locations) mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:189 — mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:189 · mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:219 — 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 (17 lines × 2 locations) mpp-vscode/src/commands/codelens-commands.ts:102 — mpp-vscode/src/commands/codelens-commands.ts:102 · mpp-vscode/src/commands/codelens-commands.ts:123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) mpp-vscode/src/actions/auto-actions.ts:81 — mpp-vscode/src/actions/auto-actions.ts:81 · mpp-vscode/src/actions/auto-actions.ts:149 — 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 (16 lines × 2 locations) mpp-vscode/webview/src/components/FileChip.tsx:73 — mpp-vscode/webview/src/components/FileChip.tsx:73 · mpp-vscode/webview/src/components/FileSearchPopup.tsx:40 — 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 (16 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (16 matched lines × 2 locations) mpp-vscode/src/services/diff-manager.ts:134 — mpp-vscode/src/services/diff-manager.ts:134 · mpp-vscode/src/services/diff-manager.ts:161 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (16 matched lines × 2 locations) mpp-vscode/webview/src/components/FileSearchPopup.tsx:114 — mpp-vscode/webview/src/components/FileSearchPopup.tsx:114 · mpp-vscode/webview/src/components/Omnibar.tsx:159 — the two spans are one implementation copied and then locally edited — 154 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 (15 lines × 3 locations) · ×2
  • Duplicated block (15 lines × 3 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1773 — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1773 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1826 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1907 — 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.
  • Duplicated block (15 lines × 3 locations) mpp-vscode/src/commands/codelens-commands.ts:144 — mpp-vscode/src/commands/codelens-commands.ts:144 · mpp-vscode/src/commands/codelens-commands.ts:166 · mpp-vscode/src/commands/codelens-commands.ts:188 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×2
  • Duplicated block (15 lines × 2 locations) mpp-ui/src/jsMain/typescript/ui/App.tsx:76 — mpp-ui/src/jsMain/typescript/ui/App.tsx:76 · mpp-ui/src/jsMain/typescript/ui/App.tsx:114 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) mpp-vscode/webview/src/components/ModelConfigDialog.tsx:132 — mpp-vscode/webview/src/components/ModelConfigDialog.tsx:132 · mpp-vscode/webview/src/components/ModelConfigDialog.tsx:155 — both copies are in the same file, so extract the 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 (12 lines × 3 locations) · ×2
  • Duplicated block (12 lines × 3 locations) mpp-codegraph/webpack.config.d/node-polyfills.js:7 — mpp-codegraph/webpack.config.d/node-polyfills.js:7 · mpp-core/webpack.config.d/node-polyfills.js:5 · mpp-ui/webpack.config.d/node-polyfills.js:5 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (12 lines × 3 locations) mpp-ui/src/jsMain/typescript/agents/LLMService.ts:86 — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:86 · mpp-ui/src/jsMain/typescript/agents/LLMService.ts:147 · mpp-web/src/services/LLMService.ts:96 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X2 · Cancellation propagation · Async function without AbortSignal · ×2
  • Async function without AbortSignal: getProjects mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:185 — `getProjects` 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: healthCheck mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:199 — `healthCheck` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X3 · Exception handling · Swallowed exception (empty catch) · ×2
  • Swallowed exception (empty catch) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:113 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/FilePathCompletionProvider.kt:130 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (2.8 · ×1
  • Low contrast colour pair in CSS (2.8:1) mpp-vscode/webview/src/components/sketch/DiffRenderer.css:53 — `.diff-action-btn.accept` sets color: white on background-color: #4caf50 — 2.8:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.7 · ×1
  • Low contrast colour pair in CSS (3.7:1) mpp-vscode/webview/src/components/sketch/TerminalRenderer.css:39 — `.terminal-status.error` sets color: white on background-color: #f44336 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
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 45 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.
C1 · Data Protection · No data-protection/encryption · ×1
  • No data-protection/encryption mpp-ui/src/commonMain/sqldelight/cc/unitmesh/devins/db/Session.sq:106 — No encryption usage (javax.crypto's Cipher in ENCRYPT_MODE, Tink, Jasypt, Spring Security's Encryptors, Jetpack Security's EncryptedSharedPreferences or EncryptedFile, the Android Keystore, SQLCipher, pgcrypto) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
D1 · Cyclomatic Complexity · DevInEditorInputKt.DevInEditorInput (cyclomatic 108) · ×1
  • DevInEditorInputKt.DevInEditorInput (cyclomatic 108) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt:79 — DevInEditorInputKt.DevInEditorInput has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NanoExpressionEvaluator.evaluateCondition (cyclomatic 85) · ×1
  • NanoExpressionEvaluator.evaluateCondition (cyclomatic 85) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:680 — NanoExpressionEvaluator.evaluateCondition has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolCallItemKt.ToolItem (cyclomatic 75) · ×1
  • ToolCallItemKt.ToolItem (cyclomatic 75) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolCallItem.kt:59 — ToolCallItemKt.ToolItem has cyclomatic complexity 75 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · App.App (cyclomatic 67) · ×1
  • App.App (cyclomatic 67) mpp-vscode/webview/src/App.tsx:48 — App.App has cyclomatic complexity 67 (threshold 15). Most of this is not in the body itself: 12 of the 67 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 86, 370, 406, …). 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 · AutoDevAppKt.AutoDevContent (cyclomatic 61) · ×1
  • AutoDevAppKt.AutoDevContent (cyclomatic 61) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:84 — AutoDevAppKt.AutoDevContent has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatDBStepCardKt.StepDetails (cyclomatic 61) · ×1
  • ChatDBStepCardKt.StepDetails (cyclomatic 61) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:168 — ChatDBStepCardKt.StepDetails has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PatternFuncProcessor.patternFunctionExecute (cyclomatic 58) · ×1
  • PatternFuncProcessor.patternFunctionExecute (cyclomatic 58) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternFuncProcessor.kt:45 — PatternFuncProcessor.patternFunctionExecute has cyclomatic complexity 58 (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 · IndentParser.parseArgs (cyclomatic 56) · ×1
  • IndentParser.parseArgs (cyclomatic 56) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1506 — IndentParser.parseArgs 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 · RoutingKt.configureRouting (cyclomatic 55) · ×1
  • RoutingKt.configureRouting (cyclomatic 55) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:27 — RoutingKt.configureRouting has cyclomatic complexity 55 (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 · AcpAgentServer.classifyToolKind (cyclomatic 55) · ×1
  • AcpAgentServer.classifyToolKind (cyclomatic 55) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:194 — AcpAgentServer.classifyToolKind has cyclomatic complexity 55 (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 · WebEditPageKt.WebEditPage (cyclomatic 53) · ×1
  • WebEditPageKt.WebEditPage (cyclomatic 53) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:159 — WebEditPageKt.WebEditPage has cyclomatic complexity 53 (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 · IdeaAgentAppKt.IdeaAgentApp (cyclomatic 53) · ×1
  • IdeaAgentAppKt.IdeaAgentApp (cyclomatic 53) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt:67 — IdeaAgentAppKt.IdeaAgentApp has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DocQLResultFormatter.formatDocQLResult (cyclomatic 53) · ×1
  • DocQLResultFormatter.formatDocQLResult (cyclomatic 53) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:413 — DocQLResultFormatter.formatDocQLResult has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · validate-scenarios.validateScenario (cyclomatic 53) · ×1
  • validate-scenarios.validateScenario (cyclomatic 53) mpp-ui/scripts/validate-scenarios.js:57 — validate-scenarios.validateScenario has cyclomatic complexity 53 (threshold 15). Of this number, 36 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 · ModelConfigDialog.ModelConfigDialog (cyclomatic 53) · ×1
  • ModelConfigDialog.ModelConfigDialog (cyclomatic 53) mpp-vscode/webview/src/components/ModelConfigDialog.tsx:40 — ModelConfigDialog.ModelConfigDialog has cyclomatic complexity 53 (threshold 15). Of this number, 28 points are the body's own statements and 25 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 · AccessibilityTree.computeRole (cyclomatic 51) · ×1
  • AccessibilityTree.computeRole (cyclomatic 51) mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/AccessibilityTree.kt:74 — AccessibilityTree.computeRole has cyclomatic complexity 51 (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 · ChatInterface.ChatInterface (cyclomatic 51) · ×1
  • ChatInterface.ChatInterface (cyclomatic 51) mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:36 — ChatInterface.ChatInterface has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 11 of the 51 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 215, enhanceCurrentInput, a function literal at line 63, …). 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 · DocumentCli.main (cyclomatic 50) · ×1
  • DocumentCli.main (cyclomatic 50) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:38 — DocumentCli.main has cyclomatic complexity 50 (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 · ModelConfigDialogKt.ModelConfigDialog (cyclomatic 48) · ×1
  • ModelConfigDialogKt.ModelConfigDialog (cyclomatic 48) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:38 — ModelConfigDialogKt.ModelConfigDialog has cyclomatic complexity 48 (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 · IdeaToolCallBubbleKt.IdeaToolCallBubble (cyclomatic 46) · ×1
  • IdeaToolCallBubbleKt.IdeaToolCallBubble (cyclomatic 46) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:44 — IdeaToolCallBubbleKt.IdeaToolCallBubble has cyclomatic complexity 46 (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 · StemmerState.step4 (cyclomatic 46) · ×1
  • StemmerState.step4 (cyclomatic 46) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:422 — StemmerState.step4 has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LanguageDetector.detectLanguage (cyclomatic 45) · ×1
  • LanguageDetector.detectLanguage (cyclomatic 45) mpp-viewer/src/commonMain/kotlin/cc/unitmesh/viewer/LanguageDetector.kt:13 — LanguageDetector.detectLanguage has cyclomatic complexity 45 (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 · NanoExpressionEvaluator.resolvePathAny (cyclomatic 44) · ×1
  • NanoExpressionEvaluator.resolvePathAny (cyclomatic 44) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:362 — NanoExpressionEvaluator.resolvePathAny has cyclomatic complexity 44 (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 · jvmKt.WebEditView (cyclomatic 44) · ×1
  • jvmKt.WebEditView (cyclomatic 44) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView 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 · CodingAgentPageKt.CodingAgentPage (cyclomatic 43) · ×1
  • CodingAgentPageKt.CodingAgentPage (cyclomatic 43) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:35 — CodingAgentPageKt.CodingAgentPage 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 · App.WebUiApp (cyclomatic 42) · ×1
  • App.WebUiApp (cyclomatic 42) mpp-web/src/App.tsx:7 — App.WebUiApp has cyclomatic complexity 42 (threshold 15). Of this number, 23 points are the body's own statements and 19 belong to 7 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 · jvmKt.LiveTerminalItem (cyclomatic 41) · ×1
  • jvmKt.LiveTerminalItem (cyclomatic 41) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:76 — jvmKt.LiveTerminalItem has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatInput.ChatInput (cyclomatic 41) · ×1
  • ChatInput.ChatInput (cyclomatic 41) mpp-vscode/webview/src/components/ChatInput.tsx:32 — ChatInput.ChatInput has cyclomatic complexity 41 (threshold 15). Of this number, 17 points are the body's own statements and 24 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MultiDatabaseChatDBExecutor.execute (cyclomatic 40) · ×1
  • MultiDatabaseChatDBExecutor.execute (cyclomatic 40) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:101 — MultiDatabaseChatDBExecutor.execute 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 · CliRenderer.formatToolCallDisplay (cyclomatic 40) · ×1
  • CliRenderer.formatToolCallDisplay (cyclomatic 40) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:232 — CliRenderer.formatToolCallDisplay has cyclomatic complexity 40 (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 · PatternActionFunc.from (cyclomatic 39) · ×1
  • PatternActionFunc.from (cyclomatic 39) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternActionFunc.kt:192 — PatternActionFunc.from 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 · IndentParser.createNode (cyclomatic 38) · ×1
  • IndentParser.createNode (cyclomatic 38) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1209 — IndentParser.createNode has cyclomatic complexity 38 (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 · ClaudeCodeClient.promptAndRender (cyclomatic 38) · ×1
  • ClaudeCodeClient.promptAndRender (cyclomatic 38) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt:122 — ClaudeCodeClient.promptAndRender 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 · TopBarMenuMobileKt.TopBarMenuMobile (cyclomatic 37) · ×1
  • TopBarMenuMobileKt.TopBarMenuMobile (cyclomatic 37) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:20 — TopBarMenuMobileKt.TopBarMenuMobile has cyclomatic complexity 37 (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 · NodeReplRuntime.readTopLevelBindingDeclarations (cyclomatic 37) · ×1
  • NodeReplRuntime.readTopLevelBindingDeclarations (cyclomatic 37) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1431 — NodeReplRuntime.readTopLevelBindingDeclarations has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InsCommandFactory.createCommand (cyclomatic 36) · ×1
  • InsCommandFactory.createCommand (cyclomatic 36) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/processor/InsCommandFactory.kt:49 — InsCommandFactory.createCommand has cyclomatic complexity 36 (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 · IdeaSketchRenderer.RenderResponse (cyclomatic 35) · ×1
  • IdeaSketchRenderer.RenderResponse (cyclomatic 35) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaSketchRenderer.kt:44 — IdeaSketchRenderer.RenderResponse 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 · DocumentChatPaneKt.ChatInputArea (cyclomatic 34) · ×1
  • DocumentChatPaneKt.ChatInputArea (cyclomatic 34) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:253 — DocumentChatPaneKt.ChatInputArea has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NanoRenderer.evaluateCondition (cyclomatic 34) · ×1
  • NanoRenderer.evaluateCondition (cyclomatic 34) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:158 — NanoRenderer.evaluateCondition has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NanoDSLBlockRendererKt.NanoDSLBlockRenderer (cyclomatic 33) · ×1
  • NanoDSLBlockRendererKt.NanoDSLBlockRenderer (cyclomatic 33) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:77 — NanoDSLBlockRendererKt.NanoDSLBlockRenderer has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SketchRenderer.Render (cyclomatic 33) · ×1
  • SketchRenderer.Render (cyclomatic 33) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/SketchRenderer.kt:77 — SketchRenderer.Render has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodingAgentExecutor.executeToolCalls (cyclomatic 33) · ×1
  • CodingAgentExecutor.executeToolCalls (cyclomatic 33) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:228 — CodingAgentExecutor.executeToolCalls has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeReplRuntime.findVariableDeclarationEnd (cyclomatic 33) · ×1
  • NodeReplRuntime.findVariableDeclarationEnd (cyclomatic 33) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1723 — NodeReplRuntime.findVariableDeclarationEnd has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionStatementProcessor.processStatement (cyclomatic 32) · ×1
  • FunctionStatementProcessor.processStatement (cyclomatic 32) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:253 — FunctionStatementProcessor.processStatement has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IdeaKnowledgeContentKt.ChatMessageItem (cyclomatic 32) · ×1
  • IdeaKnowledgeContentKt.ChatMessageItem (cyclomatic 32) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:626 — IdeaKnowledgeContentKt.ChatMessageItem has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleDslParser.parseAction (cyclomatic 32) · ×1
  • SimpleDslParser.parseAction (cyclomatic 32) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:560 — SimpleDslParser.parseAction has cyclomatic complexity 32 (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 · IndentParser.parseMultilineInlineComponentCallFromPartialStart (cyclomatic 31) · ×1
  • IndentParser.parseMultilineInlineComponentCallFromPartialStart (cyclomatic 31) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:495 — IndentParser.parseMultilineInlineComponentCallFromPartialStart 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 · ArtifactCli.main (cyclomatic 31) · ×1
  • ArtifactCli.main (cyclomatic 31) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:43 — ArtifactCli.main 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 · StemmerState.step2 (cyclomatic 31) · ×1
  • StemmerState.step2 (cyclomatic 31) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:366 — StemmerState.step2 has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AutoDevAcpClient.sessionUpdate (cyclomatic 31) · ×1
  • AutoDevAcpClient.sessionUpdate (cyclomatic 31) mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:334 — AutoDevAcpClient.sessionUpdate has cyclomatic complexity 31 (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 · LayoutComponents.RenderHStack (cyclomatic 30) · ×1
  • LayoutComponents.RenderHStack (cyclomatic 30) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/layout/LayoutComponents.kt:80 — LayoutComponents.RenderHStack has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DocQLLexer.tokenize (cyclomatic 30) · ×1
  • DocQLLexer.tokenize (cyclomatic 30) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/DocQLLexer.kt:10 — DocQLLexer.tokenize 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 · DocQLParser.parseFilterCondition (cyclomatic 30) · ×1
  • DocQLParser.parseFilterCondition (cyclomatic 30) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/DocQLParser.kt:99 — DocQLParser.parseFilterCondition has cyclomatic complexity 30 (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 · BaseDocQLExecutor.filterEntities (cyclomatic 29) · ×1
  • BaseDocQLExecutor.filterEntities (cyclomatic 29) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:278 — BaseDocQLExecutor.filterEntities has cyclomatic complexity 29 (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 · IndentParser.parseMultilineInlineComponentCall (cyclomatic 28) · ×1
  • IndentParser.parseMultilineInlineComponentCall (cyclomatic 28) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:581 — IndentParser.parseMultilineInlineComponentCall 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 · ComposeRenderer.renderToolResult (cyclomatic 28) · ×1
  • ComposeRenderer.renderToolResult (cyclomatic 28) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:543 — ComposeRenderer.renderToolResult 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 · DocQLResultFormatter.formatFallbackResult (cyclomatic 28) · ×1
  • DocQLResultFormatter.formatFallbackResult (cyclomatic 28) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:206 — DocQLResultFormatter.formatFallbackResult 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 · androidKt.buildLetsPlotFigure (cyclomatic 27) · ×1
  • androidKt.buildLetsPlotFigure (cyclomatic 27) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:110 — androidKt.buildLetsPlotFigure 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 · appleKt.AppleAutoDevContent (cyclomatic 27) · ×1
  • appleKt.AppleAutoDevContent (cyclomatic 27) mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:57 — appleKt.AppleAutoDevContent has cyclomatic complexity 27 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · DocQLSearchBarKt.DocQLSearchBar (cyclomatic 27) · ×1
  • DocQLSearchBarKt.DocQLSearchBar (cyclomatic 27) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocQLSearchBar.kt:22 — DocQLSearchBarKt.DocQLSearchBar has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DomainDictDialogKt.DomainDictDialog (cyclomatic 27) · ×1
  • DomainDictDialogKt.DomainDictDialog (cyclomatic 27) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DomainDictDialog.kt:78 — DomainDictDialogKt.DomainDictDialog has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jvmKt.buildLetsPlotFigure (cyclomatic 27) · ×1
  • jvmKt.buildLetsPlotFigure (cyclomatic 27) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:115 — jvmKt.buildLetsPlotFigure 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 · SessionRoutingKt.sessionRouting (cyclomatic 27) · ×1
  • SessionRoutingKt.sessionRouting (cyclomatic 27) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:23 — SessionRoutingKt.sessionRouting has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BaseDocQLExecutor.filterTocItems (cyclomatic 27) · ×1
  • BaseDocQLExecutor.filterTocItems (cyclomatic 27) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:192 — BaseDocQLExecutor.filterTocItems 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 · ModelConfigForm.ModelConfigForm (cyclomatic 27) · ×1
  • ModelConfigForm.ModelConfigForm (cyclomatic 27) mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:42 — ModelConfigForm.ModelConfigForm has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (handleBack, handleModelSubmit, handleConfirm, …). 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 · Omnibar.Omnibar (cyclomatic 27) · ×1
  • Omnibar.Omnibar (cyclomatic 27) mpp-vscode/webview/src/components/Omnibar.tsx:80 — Omnibar.Omnibar has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 155, 204, 123, …). 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 · androidKt.AndroidAutoDevContent (cyclomatic 26) · ×1
  • androidKt.AndroidAutoDevContent (cyclomatic 26) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:62 — androidKt.AndroidAutoDevContent 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 · IssueTrackerConfigDialogKt.IssueTrackerConfigDialog (cyclomatic 26) · ×1
  • IssueTrackerConfigDialogKt.IssueTrackerConfigDialog (cyclomatic 26) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/IssueTrackerConfigDialog.kt:33 — IssueTrackerConfigDialogKt.IssueTrackerConfigDialog has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WebEditChatInputKt.WebEditChatInput (cyclomatic 26) · ×1
  • WebEditChatInputKt.WebEditChatInput (cyclomatic 26) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditChatInput.kt:384 — WebEditChatInputKt.WebEditChatInput 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 · FloatingRunButtonKt.FloatingRunButton (cyclomatic 26) · ×1
  • FloatingRunButtonKt.FloatingRunButton (cyclomatic 26) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/runconfig/FloatingRunButton.kt:52 — FloatingRunButtonKt.FloatingRunButton 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 · WebEditPreviewKt.WebEditDebugContainer (cyclomatic 26) · ×1
  • WebEditPreviewKt.WebEditDebugContainer (cyclomatic 26) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:110 — WebEditPreviewKt.WebEditDebugContainer has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NanoOptionParser.splitTopLevel (cyclomatic 25) · ×1
  • NanoOptionParser.splitTopLevel (cyclomatic 25) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/NanoPropsParser.kt:133 — NanoOptionParser.splitTopLevel 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 · AnsiParser.handleSgr (cyclomatic 25) · ×1
  • AnsiParser.handleSgr (cyclomatic 25) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/AnsiParser.kt:126 — AnsiParser.handleSgr has cyclomatic complexity 25 (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 · ReviewCli.main (cyclomatic 25) · ×1
  • ReviewCli.main (cyclomatic 25) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:32 — ReviewCli.main 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 · DocQLResultFormatter.getFilePriority (cyclomatic 25) · ×1
  • DocQLResultFormatter.getFilePriority (cyclomatic 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:49 — DocQLResultFormatter.getFilePriority has cyclomatic complexity 25 (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 · ServerRenderer.formatToolCallDisplay (cyclomatic 25) · ×1
  • ServerRenderer.formatToolCallDisplay (cyclomatic 25) mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:282 — ServerRenderer.formatToolCallDisplay 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 · FileSearchPopup.FileSearchPopup (cyclomatic 25) · ×1
  • FileSearchPopup.FileSearchPopup (cyclomatic 25) mpp-vscode/webview/src/components/FileSearchPopup.tsx:58 — FileSearchPopup.FileSearchPopup has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 79, 112, 71, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ImageAttachmentBarKt.ImageThumbnail (cyclomatic 24) · ×1
  • ImageAttachmentBarKt.ImageThumbnail (cyclomatic 24) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageAttachmentBar.kt:166 — ImageAttachmentBarKt.ImageThumbnail has cyclomatic complexity 24 (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 · App.App (cyclomatic 24) · ×1
  • App.App (cyclomatic 24) mpp-ui/src/jsMain/typescript/ui/App.tsx:26 — App.App has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 106, 43, 100, …). 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 · PlanSummaryBar.PlanSummaryBar (cyclomatic 24) · ×1
  • PlanSummaryBar.PlanSummaryBar (cyclomatic 24) mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:47 — PlanSummaryBar.PlanSummaryBar has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (findCurrentStep, getStatusIcon, getStatusClass). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · IndentParser.extractFirstRawArg (cyclomatic 23) · ×1
  • IndentParser.extractFirstRawArg (cyclomatic 23) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1680 — IndentParser.extractFirstRawArg 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 · MarkdownDocQLExecutor.filterCodeBlocks (cyclomatic 23) · ×1
  • MarkdownDocQLExecutor.filterCodeBlocks (cyclomatic 23) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:336 — MarkdownDocQLExecutor.filterCodeBlocks has cyclomatic complexity 23 (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 · DocumentMode.runDocument (cyclomatic 23) · ×1
  • DocumentMode.runDocument (cyclomatic 23) mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:106 — DocumentMode.runDocument 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 · IDEServer.start (cyclomatic 23) · ×1
  • IDEServer.start (cyclomatic 23) mpp-vscode/src/services/ide-server.ts:38 — IDEServer.start has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 66, 105, 156, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · jvmKt.InspectDebugApp (cyclomatic 22) · ×1
  • jvmKt.InspectDebugApp (cyclomatic 22) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/WebViewDebugApp.jvm.kt:150 — jvmKt.InspectDebugApp has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileSearchPopupKt.FileSearchPopup (cyclomatic 22) · ×1
  • FileSearchPopupKt.FileSearchPopup (cyclomatic 22) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:50 — FileSearchPopupKt.FileSearchPopup 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 · CodexMode.handleInput (cyclomatic 22) · ×1
  • CodexMode.handleInput (cyclomatic 22) mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:105 — CodexMode.handleInput has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NodeReplRuntime.findMatchingBraceEnd (cyclomatic 22) · ×1
  • NodeReplRuntime.findMatchingBraceEnd (cyclomatic 22) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1657 — NodeReplRuntime.findMatchingBraceEnd 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 · ToolItemKt.ToolResultItem (cyclomatic 21) · ×1
  • ToolItemKt.ToolResultItem (cyclomatic 21) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolItem.kt:42 — ToolItemKt.ToolResultItem 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 · DiffCenterViewKt.DiffCenterView (cyclomatic 21) · ×1
  • DiffCenterViewKt.DiffCenterView (cyclomatic 21) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:58 — DiffCenterViewKt.DiffCenterView 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 · NodeReplRuntime.findBlockDeclarationEnd (cyclomatic 21) · ×1
  • NodeReplRuntime.findBlockDeclarationEnd (cyclomatic 21) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1593 — NodeReplRuntime.findBlockDeclarationEnd 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 · index.runCodingAgent (cyclomatic 21) · ×1
  • index.runCodingAgent (cyclomatic 21) mpp-ui/src/jsMain/typescript/index.tsx:62 — index.runCodingAgent 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 · NanoExpressionEvaluator.evaluateStringExpressionOrNull (cyclomatic 20) · ×1
  • NanoExpressionEvaluator.evaluateStringExpressionOrNull (cyclomatic 20) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:203 — NanoExpressionEvaluator.evaluateStringExpressionOrNull 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 · IndentParser.collectStateDefaultValue (cyclomatic 20) · ×1
  • IndentParser.collectStateDefaultValue (cyclomatic 20) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:239 — IndentParser.collectStateDefaultValue 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 · WebEditAutomationKt.runOneSentenceCommand (cyclomatic 20) · ×1
  • WebEditAutomationKt.runOneSentenceCommand (cyclomatic 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:63 — WebEditAutomationKt.runOneSentenceCommand 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 · ToolConfigDialogKt.ToolConfigDialog (cyclomatic 20) · ×1
  • ToolConfigDialogKt.ToolConfigDialog (cyclomatic 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:34 — ToolConfigDialogKt.ToolConfigDialog 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 · ModelSelectorKt.ModelSelector (cyclomatic 20) · ×1
  • ModelSelectorKt.ModelSelector (cyclomatic 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelSelector.kt:29 — ModelSelectorKt.ModelSelector 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 · jvmKt.FileViewerPanel (cyclomatic 20) · ×1
  • jvmKt.FileViewerPanel (cyclomatic 20) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:23 — jvmKt.FileViewerPanel has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: jvmKt.getSyntaxStyleForFile (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ResponseBodyCallback.onResponse (cyclomatic 20) · ×1
  • ResponseBodyCallback.onResponse (cyclomatic 20) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/ResponseBodyCallback.kt:47 — ResponseBodyCallback.onResponse 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 · JewelRenderer.renderToolResult (cyclomatic 20) · ×1
  • JewelRenderer.renderToolResult (cyclomatic 20) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:467 — JewelRenderer.renderToolResult 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 · DiffParser.parseGitDiffBlock (cyclomatic 20) · ×1
  • DiffParser.parseGitDiffBlock (cyclomatic 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffModels.kt:126 — DiffParser.parseGitDiffBlock 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 · GitIgnorePatternMatcher.patternToRegex (cyclomatic 20) · ×1
  • GitIgnorePatternMatcher.patternToRegex (cyclomatic 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreFilter.kt:50 — GitIgnorePatternMatcher.patternToRegex 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 · FrontMatterProcessor.processFrontMatter (cyclomatic 20) · ×1
  • FrontMatterProcessor.processFrontMatter (cyclomatic 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/FrontMatterProcessor.kt:33 — FrontMatterProcessor.processFrontMatter has cyclomatic complexity 20 (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 · AcpClient.renderSessionUpdate (cyclomatic 20) · ×1
  • AcpClient.renderSessionUpdate (cyclomatic 20) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:641 — AcpClient.renderSessionUpdate 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 · NanoDSLRenderer.NanoDSLRenderer (cyclomatic 20) · ×1
  • NanoDSLRenderer.NanoDSLRenderer (cyclomatic 20) mpp-vscode/webview/src/components/sketch/NanoDSLRenderer.tsx:24 — NanoDSLRenderer.NanoDSLRenderer has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · IndentParser.parseForLoopWithMultilineIterable (cyclomatic 19) · ×1
  • IndentParser.parseForLoopWithMultilineIterable (cyclomatic 19) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:410 — IndentParser.parseForLoopWithMultilineIterable 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 · NanoAspectRatioParser.parse (cyclomatic 19) · ×1
  • NanoAspectRatioParser.parse (cyclomatic 19) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/NanoAspectRatioParser.kt:27 — NanoAspectRatioParser.parse 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 · NanoStateRuntime.coerceSetValue (cyclomatic 19) · ×1
  • NanoStateRuntime.coerceSetValue (cyclomatic 19) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:200 — NanoStateRuntime.coerceSetValue 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 · EditorUtilCopy.indentLine (cyclomatic 19) · ×1
  • EditorUtilCopy.indentLine (cyclomatic 19) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/presentation/EditorUtilCopy.kt:20 — EditorUtilCopy.indentLine 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 · IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent (cyclomatic 19) · ×1
  • IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent (cyclomatic 19) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:142 — IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent 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 · ToolCallParser.parseKeyValueParametersCharByChar (cyclomatic 19) · ×1
  • ToolCallParser.parseKeyValueParametersCharByChar (cyclomatic 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/ToolCallParser.kt:197 — ToolCallParser.parseKeyValueParametersCharByChar has cyclomatic complexity 19 (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 · UrlParser.isValidHttpUrl (cyclomatic 19) · ×1
  • UrlParser.isValidHttpUrl (cyclomatic 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:59 — UrlParser.isValidHttpUrl has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SelfHealingLocator.calculateSimilarity (cyclomatic 19) · ×1
  • SelfHealingLocator.calculateSimilarity (cyclomatic 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/SelfHealingLocator.kt:90 — SelfHealingLocator.calculateSimilarity 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 · SimpleDslParser.parse (cyclomatic 19) · ×1
  • SimpleDslParser.parse (cyclomatic 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:465 — SimpleDslParser.parse has cyclomatic complexity 19 (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 · JsCodeParser.processNode (cyclomatic 19) · ×1
  • JsCodeParser.processNode (cyclomatic 19) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:285 — JsCodeParser.processNode 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 · JvmCodeParser.extractJsImports (cyclomatic 19) · ×1
  • JvmCodeParser.extractJsImports (cyclomatic 19) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:252 — JvmCodeParser.extractJsImports has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JvmCodeParser.processNode (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MessageRenderer.ContentBlocks (cyclomatic 19) · ×1
  • MessageRenderer.ContentBlocks (cyclomatic 19) mpp-ui/src/jsMain/typescript/ui/MessageRenderer.tsx:332 — MessageRenderer.ContentBlocks has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 346, 371, 399). 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 · SlashCommandProcessor.handleDeepResearchCommand (cyclomatic 19) · ×1
  • SlashCommandProcessor.handleDeepResearchCommand (cyclomatic 19) mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:374 — SlashCommandProcessor.handleDeepResearchCommand has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentMode.handleInput (cyclomatic 19) · ×1
  • AgentMode.handleInput (cyclomatic 19) mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:127 — AgentMode.handleInput 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatMode.handleInput (cyclomatic 19) · ×1
  • ChatMode.handleInput (cyclomatic 19) mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:69 — ChatMode.handleInput 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DevInRenderer.DevInToolItem (cyclomatic 19) · ×1
  • DevInRenderer.DevInToolItem (cyclomatic 19) mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx:117 — DevInRenderer.DevInToolItem has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NumericExprParser.parsePathToken (cyclomatic 18) · ×1
  • NumericExprParser.parsePathToken (cyclomatic 18) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:587 — NumericExprParser.parsePathToken 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 · CodeReviewAgentPanelKt.CodeReviewAgentPanel (cyclomatic 18) · ×1
  • CodeReviewAgentPanelKt.CodeReviewAgentPanel (cyclomatic 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:57 — CodeReviewAgentPanelKt.CodeReviewAgentPanel 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 · GitGraphBuilder.buildAsciiGraph (cyclomatic 18) · ×1
  • GitGraphBuilder.buildAsciiGraph (cyclomatic 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/GitGraphModel.kt:262 — GitGraphBuilder.buildAsciiGraph 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 · DocQLStatsSectionKt.DocQLStatsSection (cyclomatic 18) · ×1
  • DocQLStatsSectionKt.DocQLStatsSection (cyclomatic 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:34 — DocQLStatsSectionKt.DocQLStatsSection has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BottomToolbarKt.BottomToolbar (cyclomatic 18) · ×1
  • BottomToolbarKt.BottomToolbar (cyclomatic 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/BottomToolbar.kt:25 — BottomToolbarKt.BottomToolbar 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 · TaskExecutionScreenKt.getEventInfo (cyclomatic 18) · ×1
  • TaskExecutionScreenKt.getEventInfo (cyclomatic 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:213 — TaskExecutionScreenKt.getEventInfo 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 · AcpReplayCli.replayCapture (cyclomatic 18) · ×1
  • AcpReplayCli.replayCapture (cyclomatic 18) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/AcpReplayCli.kt:49 — AcpReplayCli.replayCapture has cyclomatic complexity 18 (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 · E2ECli.loadLLMConfig (cyclomatic 18) · ×1
  • E2ECli.loadLLMConfig (cyclomatic 18) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:118 — E2ECli.loadLLMConfig has cyclomatic complexity 18 (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 · SessionManager.broadcastEvent (cyclomatic 18) · ×1
  • SessionManager.broadcastEvent (cyclomatic 18) mpp-server/src/main/kotlin/cc/unitmesh/server/session/SessionManager.kt:104 — SessionManager.broadcastEvent has cyclomatic complexity 18 (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 · FunctionStatementProcessor.executeComparison (cyclomatic 18) · ×1
  • FunctionStatementProcessor.executeComparison (cyclomatic 18) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:199 — FunctionStatementProcessor.executeComparison 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 · IdeaFileSearchPopupKt.FileSearchPopupContent (cyclomatic 18) · ×1
  • IdeaFileSearchPopupKt.FileSearchPopupContent (cyclomatic 18) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:92 — IdeaFileSearchPopupKt.FileSearchPopupContent 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 · StemmerState.step1 (cyclomatic 18) · ×1
  • StemmerState.step1 (cyclomatic 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:345 — StemmerState.step1 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 · ToolOrchestrator.executeToolCall (cyclomatic 18) · ×1
  • ToolOrchestrator.executeToolCall (cyclomatic 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt:57 — ToolOrchestrator.executeToolCall 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 · MarkdownDocQLExecutor.filterTables (cyclomatic 18) · ×1
  • MarkdownDocQLExecutor.filterTables (cyclomatic 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:523 — MarkdownDocQLExecutor.filterTables has cyclomatic complexity 18 (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 · JvmCodeParser.handleFragmentedClasses (cyclomatic 18) · ×1
  • JvmCodeParser.handleFragmentedClasses (cyclomatic 18) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:600 — JvmCodeParser.handleFragmentedClasses has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: JvmCodeParser.processNode (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · NodeReplRuntime.splitTopLevelDeclarators (cyclomatic 18) · ×1
  • NodeReplRuntime.splitTopLevelDeclarators (cyclomatic 18) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1929 — NodeReplRuntime.splitTopLevelDeclarators 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 · index.runServerAgent (cyclomatic 18) · ×1
  • index.runServerAgent (cyclomatic 18) mpp-ui/src/jsMain/typescript/index.tsx:249 — index.runServerAgent 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 · codeFence.parseCodeBlocks (cyclomatic 18) · ×1
  • codeFence.parseCodeBlocks (cyclomatic 18) mpp-vscode/webview/src/utils/codeFence.ts:60 — codeFence.parseCodeBlocks has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NanoState.mutate (cyclomatic 17) · ×1
  • NanoState.mutate (cyclomatic 17) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoState.kt:174 — NanoState.mutate 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 · MarkdownInline.parse (cyclomatic 17) · ×1
  • MarkdownInline.parse (cyclomatic 17) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/text/MarkdownInline.kt:34 — MarkdownInline.parse 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 · ArtifactMessageListKt.ArtifactMessageList (cyclomatic 17) · ×1
  • ArtifactMessageListKt.ArtifactMessageList (cyclomatic 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactMessageList.kt:33 — ArtifactMessageListKt.ArtifactMessageList 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 · CodeAnalyzer.analyzeModifiedCode (cyclomatic 17) · ×1
  • CodeAnalyzer.analyzeModifiedCode (cyclomatic 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/analysis/CodeAnalyzer.kt:30 — CodeAnalyzer.analyzeModifiedCode 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 · LintExecutor.runLint (cyclomatic 17) · ×1
  • LintExecutor.runLint (cyclomatic 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/analysis/LintExecutor.kt:23 — LintExecutor.runLint 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 · FileChangeSummaryKt.FileChangeSummary (cyclomatic 17) · ×1
  • FileChangeSummaryKt.FileChangeSummary (cyclomatic 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:34 — FileChangeSummaryKt.FileChangeSummary 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 · RemoteCodingAgentViewModel.handleRemoteEvent (cyclomatic 17) · ×1
  • RemoteCodingAgentViewModel.handleRemoteEvent (cyclomatic 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteCodingAgentViewModel.kt:183 — RemoteCodingAgentViewModel.handleRemoteEvent 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 · CmdWrapper.findBinary (cyclomatic 17) · ×1
  • CmdWrapper.findBinary (cyclomatic 17) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/linecount/CmdWrapper.kt:54 — CmdWrapper.findBinary 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 · CustomSSEProcessor.streamSSE (cyclomatic 17) · ×1
  • CustomSSEProcessor.streamSSE (cyclomatic 17) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt:71 — CustomSSEProcessor.streamSSE 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 · MethodCall.evaluateExpression (cyclomatic 17) · ×1
  • MethodCall.evaluateExpression (cyclomatic 17) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/ShireExpression.kt:291 — MethodCall.evaluateExpression 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 · JavaContextCollection.simpleStructure (cyclomatic 17) · ×1
  • JavaContextCollection.simpleStructure (cyclomatic 17) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaContextCollection.kt:43 — JavaContextCollection.simpleStructure 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 · IdeaRemoteAgentViewModel.handleRemoteEvent (cyclomatic 17) · ×1
  • IdeaRemoteAgentViewModel.handleRemoteEvent (cyclomatic 17) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:199 — IdeaRemoteAgentViewModel.handleRemoteEvent 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 · DocumentAgentExecutor.checkForLongContent (cyclomatic 17) · ×1
  • DocumentAgentExecutor.checkForLongContent (cyclomatic 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:305 — DocumentAgentExecutor.checkForLongContent has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgentToolFormatter.generateDevInsExample (cyclomatic 17) · ×1
  • AgentToolFormatter.generateDevInsExample (cyclomatic 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/schema/AgentToolFormatter.kt:195 — AgentToolFormatter.generateDevInsExample 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 · DevInsLexer.tokenizeFunctionDecl (cyclomatic 17) · ×1
  • DevInsLexer.tokenizeFunctionDecl (cyclomatic 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:645 — DevInsLexer.tokenizeFunctionDecl 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. This is NOT this file's highest cyclomatic complexity: DevInsLexer.nextToken (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · OpenRouterModels.create (cyclomatic 17) · ×1
  • OpenRouterModels.create (cyclomatic 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:287 — OpenRouterModels.create 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 · AcpClient.promptAndRender (cyclomatic 17) · ×1
  • AcpClient.promptAndRender (cyclomatic 17) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:234 — AcpClient.promptAndRender 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 · TuiRenderer.formatToolParams (cyclomatic 17) · ×1
  • TuiRenderer.formatToolParams (cyclomatic 17) mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:206 — TuiRenderer.formatToolParams 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 · NodeReplRuntime.readVariableDeclaratorPattern (cyclomatic 17) · ×1
  • NodeReplRuntime.readVariableDeclaratorPattern (cyclomatic 17) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 — NodeReplRuntime.readVariableDeclaratorPattern has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (NodeReplRuntime.findTopLevelCharacter) 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 · NodeReplRuntime.findTopLevelCharacter (cyclomatic 17) · ×1
  • NodeReplRuntime.findTopLevelCharacter (cyclomatic 17) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1888 — NodeReplRuntime.findTopLevelCharacter has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (NodeReplRuntime.readVariableDeclaratorPattern) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · server.handleLine (cyclomatic 17) · ×1
  • server.handleLine (cyclomatic 17) mpp-ui/src/jsMain/typescript/node-repl/server.ts:97 — server.handleLine 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 · CompletionPopup.CompletionPopup (cyclomatic 17) · ×1
  • CompletionPopup.CompletionPopup (cyclomatic 17) mpp-vscode/webview/src/components/CompletionPopup.tsx:58 — CompletionPopup.CompletionPopup has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 62, 103, 92). 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 · NanoExpressionEvaluator.parseStringCallArgs (cyclomatic 16) · ×1
  • NanoExpressionEvaluator.parseStringCallArgs (cyclomatic 16) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:253 — NanoExpressionEvaluator.parseStringCallArgs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: NanoExpressionEvaluator.evaluateExpression (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · NanoStateRuntime.applyStateMutation (cyclomatic 16) · ×1
  • NanoStateRuntime.applyStateMutation (cyclomatic 16) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:146 — NanoStateRuntime.applyStateMutation has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · NanoImageRendererKt.RenderImageContent (cyclomatic 16) · ×1
  • NanoImageRendererKt.RenderImageContent (cyclomatic 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageRenderer.kt:61 — NanoImageRendererKt.RenderImageContent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · WorkflowControllerKt.workflowRoutes (cyclomatic 16) · ×1
  • WorkflowControllerKt.workflowRoutes (cyclomatic 16) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:32 — WorkflowControllerKt.workflowRoutes 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 · AutoDevContainer.updateForDevContainer (cyclomatic 16) · ×1
  • AutoDevContainer.updateForDevContainer (cyclomatic 16) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/container/AutoDevContainer.kt:14 — AutoDevContainer.updateForDevContainer has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · LLMProviderAdapter.stream (cyclomatic 16) · ×1
  • LLMProviderAdapter.stream (cyclomatic 16) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:106 — LLMProviderAdapter.stream 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 · LLMDialog.doOKAction (cyclomatic 16) · ×1
  • LLMDialog.doOKAction (cyclomatic 16) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:332 — LLMDialog.doOKAction 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 · LibraryVersionFetchInsCommand.autoDetectAndFetch (cyclomatic 16) · ×1
  • LibraryVersionFetchInsCommand.autoDetectAndFetch (cyclomatic 16) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/idea/LibraryVersionFetchInsCommand.kt:72 — LibraryVersionFetchInsCommand.autoDetectAndFetch has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · EditorInteractionProvider.execute (cyclomatic 16) · ×1
  • EditorInteractionProvider.execute (cyclomatic 16) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/EditorInteractionProvider.kt:32 — EditorInteractionProvider.execute has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · NanoDSLValidator.performBasicValidation (cyclomatic 16) · ×1
  • NanoDSLValidator.performBasicValidation (cyclomatic 16) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:106 — NanoDSLValidator.performBasicValidation 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 · DiffParser.parse (cyclomatic 16) · ×1
  • DiffParser.parse (cyclomatic 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffModels.kt:46 — DiffParser.parse 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 · GitWorkspaceSnapshot.diff (cyclomatic 16) · ×1
  • GitWorkspaceSnapshot.diff (cyclomatic 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:47 — GitWorkspaceSnapshot.diff 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 · LinterSummary.format (cyclomatic 16) · ×1
  • LinterSummary.format (cyclomatic 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:21 — LinterSummary.format 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 · CodeBlockProcessor.inferLanguageFromContent (cyclomatic 16) · ×1
  • CodeBlockProcessor.inferLanguageFromContent (cyclomatic 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/CodeBlockProcessor.kt:104 — CodeBlockProcessor.inferLanguageFromContent 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 · GitLogParser.parse (cyclomatic 16) · ×1
  • GitLogParser.parse (cyclomatic 16) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitLogParser.kt:28 — GitLogParser.parse 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 · CliRenderer.generateToolSummary (cyclomatic 16) · ×1
  • CliRenderer.generateToolSummary (cyclomatic 16) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:426 — CliRenderer.generateToolSummary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MessageRenderer.TreeMessageBubble (cyclomatic 16) · ×1
  • MessageRenderer.TreeMessageBubble (cyclomatic 16) mpp-ui/src/jsMain/typescript/ui/MessageRenderer.tsx:55 — MessageRenderer.TreeMessageBubble has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (renderContent, getColor, getSymbol, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ModeCommandProcessor.process (cyclomatic 16) · ×1
  • ModeCommandProcessor.process (cyclomatic 16) mpp-ui/src/jsMain/typescript/processors/ModeCommandProcessor.ts:39 — ModeCommandProcessor.process 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 · ReviewMode.parseMarkdownFindings (cyclomatic 16) · ×1
  • ReviewMode.parseMarkdownFindings (cyclomatic 16) mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:323 — ReviewMode.parseMarkdownFindings 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 · ReviewMode.displayKotlinFindings (cyclomatic 16) · ×1
  • ReviewMode.displayKotlinFindings (cyclomatic 16) mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:496 — ReviewMode.displayKotlinFindings has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (formatFinding, a function literal at line 504, a function literal at line 530). 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 · codeFence.parseMarkdownContent (cyclomatic 16) · ×1
  • codeFence.parseMarkdownContent (cyclomatic 16) mpp-vscode/webview/src/utils/codeFence.ts:158 — codeFence.parseMarkdownContent 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 · ToolCallRenderer.ToolCallRenderer · ×1
  • ToolCallRenderer.ToolCallRenderer::formatParams (cyclomatic 16) mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:45 — ToolCallRenderer.ToolCallRenderer::formatParams has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · DevInEditorInputKt.DevInEditorInput (cognitive 155) · ×1
  • DevInEditorInputKt.DevInEditorInput (cognitive 155) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt:79 — DevInEditorInputKt.DevInEditorInput has cognitive complexity 155 (threshold 15). Drivers by points: if/else 83 (115 pts), boolean chains 28, match/switch 6 (8 pts), error handling 3 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocQLResultFormatter.formatDocQLResult (cognitive 125) · ×1
  • DocQLResultFormatter.formatDocQLResult (cognitive 125) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:413 — DocQLResultFormatter.formatDocQLResult has cognitive complexity 125 (threshold 15). Drivers by points: if/else 31 (91 pts), loops 12 (32 pts), boolean chains 1, match/switch 1 (nesting depth added 80). 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 · ToolCallItemKt.ToolItem (cognitive 124) · ×1
  • ToolCallItemKt.ToolItem (cognitive 124) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolCallItem.kt:59 — ToolCallItemKt.ToolItem has cognitive complexity 124 (threshold 15). Drivers by points: if/else 77 (100 pts), boolean chains 17, match/switch 6 (7 pts) (nesting depth added 24). 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 · AutoDevAppKt.AutoDevContent (cognitive 110) · ×1
  • AutoDevAppKt.AutoDevContent (cognitive 110) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:84 — AutoDevAppKt.AutoDevContent has cognitive complexity 110 (threshold 15). Drivers by points: if/else 47 (65 pts), error handling 13 (29 pts), match/switch 4 (9 pts), boolean chains 7 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoExpressionEvaluator.evaluateCondition (cognitive 107) · ×1
  • NanoExpressionEvaluator.evaluateCondition (cognitive 107) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:680 — NanoExpressionEvaluator.evaluateCondition has cognitive complexity 107 (threshold 15). Drivers by points: if/else 43 (77 pts), match/switch 7 (14 pts), boolean chains 11, loops 4 (5 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiDatabaseChatDBExecutor.execute (cognitive 103) · ×1
  • MultiDatabaseChatDBExecutor.execute (cognitive 103) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:101 — MultiDatabaseChatDBExecutor.execute has cognitive complexity 103 (threshold 15). Drivers by points: if/else 45 (86 pts), error handling 3 (7 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatDBStepCardKt.StepDetails (cognitive 101) · ×1
  • ChatDBStepCardKt.StepDetails (cognitive 101) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:168 — ChatDBStepCardKt.StepDetails has cognitive complexity 101 (threshold 15). Drivers by points: if/else 43 (86 pts), boolean chains 14, match/switch 1 (nesting depth added 43). 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 · validate-scenarios.validateScenario (cognitive 91) · ×1
  • validate-scenarios.validateScenario (cognitive 91) mpp-ui/scripts/validate-scenarios.js:57 — validate-scenarios.validateScenario has cognitive complexity 91 (threshold 15). Drivers by points: if/else 40 (75 pts), boolean chains 12, error handling 1 (4 pts) (nesting depth added 38). Of this number, 54 points are the body's own statements and 37 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 · IdeaAgentAppKt.IdeaAgentApp (cognitive 87) · ×1
  • IdeaAgentAppKt.IdeaAgentApp (cognitive 87) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt:67 — IdeaAgentAppKt.IdeaAgentApp has cognitive complexity 87 (threshold 15). Drivers by points: if/else 33 (53 pts), boolean chains 12, match/switch 4 (10 pts), error handling 2 (8 pts), loops 1 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndentParser.parseArgs (cognitive 84) · ×1
  • IndentParser.parseArgs (cognitive 84) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1506 — IndentParser.parseArgs has cognitive complexity 84 (threshold 15). Drivers by points: if/else 25 (53 pts), loops 8 (13 pts), boolean chains 11, match/switch 3 (7 pts) (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 · IndentParser.parseMultilineInlineComponentCallFromPartialStart (cognitive 82) · ×1
  • IndentParser.parseMultilineInlineComponentCallFromPartialStart (cognitive 82) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:495 — IndentParser.parseMultilineInlineComponentCallFromPartialStart has cognitive complexity 82 (threshold 15). Drivers by points: if/else 21 (69 pts), match/switch 2 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebEditPageKt.WebEditPage (cognitive 80) · ×1
  • WebEditPageKt.WebEditPage (cognitive 80) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:159 — WebEditPageKt.WebEditPage has cognitive complexity 80 (threshold 15). Drivers by points: if/else 46 (60 pts), boolean chains 12, error handling 4 (7 pts), match/switch 1 (nesting depth added 17). 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 · IdeaToolCallBubbleKt.IdeaToolCallBubble (cognitive 80) · ×1
  • IdeaToolCallBubbleKt.IdeaToolCallBubble (cognitive 80) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:44 — IdeaToolCallBubbleKt.IdeaToolCallBubble has cognitive complexity 80 (threshold 15). Drivers by points: if/else 54 (71 pts), match/switch 4 (5 pts), boolean chains 4 (nesting depth added 18). 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 · NanoExpressionEvaluator.resolvePathAny (cognitive 79) · ×1
  • NanoExpressionEvaluator.resolvePathAny (cognitive 79) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:362 — NanoExpressionEvaluator.resolvePathAny has cognitive complexity 79 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 9 (24 pts), boolean chains 13, match/switch 4 (11 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeCodeClient.promptAndRender (cognitive 78) · ×1
  • ClaudeCodeClient.promptAndRender (cognitive 78) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/claude/ClaudeCodeClient.kt:122 — ClaudeCodeClient.promptAndRender has cognitive complexity 78 (threshold 15). Drivers by points: if/else 13 (42 pts), match/switch 6 (21 pts), error handling 2 (7 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndentParser.parseMultilineInlineComponentCall (cognitive 77) · ×1
  • IndentParser.parseMultilineInlineComponentCall (cognitive 77) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:581 — IndentParser.parseMultilineInlineComponentCall has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (64 pts), match/switch 2 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatternFuncProcessor.patternFunctionExecute (cognitive 77) · ×1
  • PatternFuncProcessor.patternFunctionExecute (cognitive 77) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternFuncProcessor.kt:45 — PatternFuncProcessor.patternFunctionExecute has cognitive complexity 77 (threshold 15). Drivers by points: if/else 31 (47 pts), match/switch 14 (30 pts) (nesting depth added 32). 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 · CodingAgentPageKt.CodingAgentPage (cognitive 75) · ×1
  • CodingAgentPageKt.CodingAgentPage (cognitive 75) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:35 — CodingAgentPageKt.CodingAgentPage has cognitive complexity 75 (threshold 15). Drivers by points: if/else 45 (67 pts), boolean chains 5, match/switch 1 (2 pts), error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StemmerState.step4 (cognitive 72) · ×1
  • StemmerState.step4 (cognitive 72) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:422 — StemmerState.step4 has cognitive complexity 72 (threshold 15). Drivers by points: if/else 27 (65 pts), boolean chains 6, match/switch 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodeReplRuntime.readTopLevelBindingDeclarations (cognitive 72) · ×1
  • NodeReplRuntime.readTopLevelBindingDeclarations (cognitive 72) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1431 — NodeReplRuntime.readTopLevelBindingDeclarations has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (53 pts), loops 3 (10 pts), boolean chains 9 (nesting depth added 39). Of this number, 70 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jvmKt.WebEditView (cognitive 66) · ×1
  • jvmKt.WebEditView (cognitive 66) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:21 — jvmKt.WebEditView has cognitive complexity 66 (threshold 15). Drivers by points: if/else 28 (54 pts), error handling 3 (7 pts), boolean chains 3, match/switch 2 (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 · App.App (cognitive 65) · ×1
  • App.App (cognitive 65) mpp-vscode/webview/src/App.tsx:48 — App.App has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 30, if/else 17 (28 pts), loops 1 (3 pts), ternaries 2 (3 pts), match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 10 of the 65 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 86, 147, 370, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NanoDSLBlockRendererKt.NanoDSLBlockRenderer (cognitive 60) · ×1
  • NanoDSLBlockRendererKt.NanoDSLBlockRenderer (cognitive 60) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:77 — NanoDSLBlockRendererKt.NanoDSLBlockRenderer has cognitive complexity 60 (threshold 15). Drivers by points: if/else 33 (48 pts), boolean chains 7, error handling 2 (5 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 · ChatInterface.ChatInterface (cognitive 60) · ×1
  • ChatInterface.ChatInterface (cognitive 60) mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:36 — ChatInterface.ChatInterface has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 18, ternaries 2 (6 pts), error handling 3 (nesting depth added 13). Most of this is not in the body itself: 6 of the 60 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 215, applyCompletion, a function literal at line 63, …). 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 · FloatingRunButtonKt.FloatingRunButton (cognitive 56) · ×1
  • FloatingRunButtonKt.FloatingRunButton (cognitive 56) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/runconfig/FloatingRunButton.kt:52 — FloatingRunButtonKt.FloatingRunButton has cognitive complexity 56 (threshold 15). Drivers by points: if/else 34 (51 pts), match/switch 2 (3 pts), boolean chains 2 (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 · JvmCodeParser.handleFragmentedClasses (cognitive 55) · ×1
  • JvmCodeParser.handleFragmentedClasses (cognitive 55) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:600 — JvmCodeParser.handleFragmentedClasses has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (39 pts), loops 3 (11 pts), boolean chains 5 (nesting depth added 37). 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 · jvmKt.LiveTerminalItem (cognitive 54) · ×1
  • jvmKt.LiveTerminalItem (cognitive 54) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:76 — jvmKt.LiveTerminalItem has cognitive complexity 54 (threshold 15). Drivers by points: if/else 32 (40 pts), boolean chains 7, error handling 2 (3 pts), loops 2, match/switch 2 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ModelConfigDialogKt.ModelConfigDialog (cognitive 53) · ×1
  • ModelConfigDialogKt.ModelConfigDialog (cognitive 53) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:38 — ModelConfigDialogKt.ModelConfigDialog has cognitive complexity 53 (threshold 15). Drivers by points: if/else 28 (33 pts), match/switch 5 (9 pts), boolean chains 8, error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ComposeRenderer.renderToolResult (cognitive 51) · ×1
  • ComposeRenderer.renderToolResult (cognitive 51) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:543 — ComposeRenderer.renderToolResult has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 10, match/switch 2 (7 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 · NodeReplRuntime.findVariableDeclarationEnd (cognitive 51) · ×1
  • NodeReplRuntime.findVariableDeclarationEnd (cognitive 51) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1723 — NodeReplRuntime.findVariableDeclarationEnd has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 11, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionStatementProcessor.processStatement (cognitive 50) · ×1
  • FunctionStatementProcessor.processStatement (cognitive 50) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:253 — FunctionStatementProcessor.processStatement has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (40 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 27). 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 · DocumentChatPaneKt.ChatInputArea (cognitive 49) · ×1
  • DocumentChatPaneKt.ChatInputArea (cognitive 49) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentChatPane.kt:253 — DocumentChatPaneKt.ChatInputArea has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 11, error handling 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodingAgentExecutor.executeToolCalls (cognitive 49) · ×1
  • CodingAgentExecutor.executeToolCalls (cognitive 49) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:228 — CodingAgentExecutor.executeToolCalls has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (35 pts), match/switch 3 (7 pts), boolean chains 4, loops 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelSelectorKt.ModelSelector (cognitive 48) · ×1
  • ModelSelectorKt.ModelSelector (cognitive 48) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelSelector.kt:29 — ModelSelectorKt.ModelSelector has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (30 pts), error handling 5 (13 pts), loops 1 (4 pts), boolean chains 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 · ArtifactCli.main (cognitive 47) · ×1
  • ArtifactCli.main (cognitive 47) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:43 — ArtifactCli.main has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (38 pts), match/switch 3 (6 pts), boolean chains 2, error handling 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 · DocumentMode.runDocument (cognitive 47) · ×1
  • DocumentMode.runDocument (cognitive 47) mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:106 — DocumentMode.runDocument has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 5, loops 1 (3 pts), 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.
D2 · Cognitive Complexity · ToolItemKt.ToolResultItem (cognitive 44) · ×1
  • ToolItemKt.ToolResultItem (cognitive 44) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolItem.kt:42 — ToolItemKt.ToolResultItem has cognitive complexity 44 (threshold 15). Drivers by points: if/else 32 (42 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · WebEditAutomationKt.runOneSentenceCommand (cognitive 44) · ×1
  • WebEditAutomationKt.runOneSentenceCommand (cognitive 44) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:63 — WebEditAutomationKt.runOneSentenceCommand has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 10, loops 2 (7 pts) (nesting depth added 20). 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 · NanoDSLAgent.execute (cognitive 44) · ×1
  • NanoDSLAgent.execute (cognitive 44) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:73 — NanoDSLAgent.execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (38 pts), match/switch 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffCenterViewKt.DiffCenterView (cognitive 43) · ×1
  • DiffCenterViewKt.DiffCenterView (cognitive 43) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:58 — DiffCenterViewKt.DiffCenterView has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 3 (9 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JewelRenderer.renderToolResult (cognitive 42) · ×1
  • JewelRenderer.renderToolResult (cognitive 42) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:467 — JewelRenderer.renderToolResult has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 7, match/switch 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelConfigDialog.ModelConfigDialog (cognitive 42) · ×1
  • ModelConfigDialog.ModelConfigDialog (cognitive 42) mpp-vscode/webview/src/components/ModelConfigDialog.tsx:40 — ModelConfigDialog.ModelConfigDialog has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 28, if/else 10, ternaries 4. Of this number, 19 points are the body's own statements and 23 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.
D2 · Cognitive Complexity · IdeaFileSearchPopupKt.FileSearchPopupContent (cognitive 41) · ×1
  • IdeaFileSearchPopupKt.FileSearchPopupContent (cognitive 41) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:92 — IdeaFileSearchPopupKt.FileSearchPopupContent has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliRenderer.formatToolCallDisplay (cognitive 40) · ×1
  • CliRenderer.formatToolCallDisplay (cognitive 40) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:232 — CliRenderer.formatToolCallDisplay has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 17, if/else 8 (14 pts), ternaries 3 (6 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NodeReplRuntime.findMatchingBraceEnd (cognitive 40) · ×1
  • NodeReplRuntime.findMatchingBraceEnd (cognitive 40) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1657 — NodeReplRuntime.findMatchingBraceEnd has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 5, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoRenderer.evaluateCondition (cognitive 40) · ×1
  • NanoRenderer.evaluateCondition (cognitive 40) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:158 — NanoRenderer.evaluateCondition has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 12 (13 pts), boolean chains 9, 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 · IssueTrackerConfigDialogKt.IssueTrackerConfigDialog (cognitive 38) · ×1
  • IssueTrackerConfigDialogKt.IssueTrackerConfigDialog (cognitive 38) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/IssueTrackerConfigDialog.kt:33 — IssueTrackerConfigDialogKt.IssueTrackerConfigDialog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 4, match/switch 2 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · TopBarMenuMobileKt.TopBarMenuMobile (cognitive 38) · ×1
  • TopBarMenuMobileKt.TopBarMenuMobile (cognitive 38) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:20 — TopBarMenuMobileKt.TopBarMenuMobile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (33 pts), match/switch 3 (5 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ToolConfigDialogKt.ToolConfigDialog (cognitive 38) · ×1
  • ToolConfigDialogKt.ToolConfigDialog (cognitive 38) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:34 — ToolConfigDialogKt.ToolConfigDialog has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 6 (12 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 · WebEditPreviewKt.WebEditDebugContainer (cognitive 38) · ×1
  • WebEditPreviewKt.WebEditDebugContainer (cognitive 38) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:110 — WebEditPreviewKt.WebEditDebugContainer has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 4, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · ChatInput.ChatInput (cognitive 38) · ×1
  • ChatInput.ChatInput (cognitive 38) mpp-vscode/webview/src/components/ChatInput.tsx:32 — ChatInput.ChatInput has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 19, if/else 14 (15 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 12 of the 38 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 65, a function literal at line 79, handleSubmit, …). 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 · IdeaKnowledgeContentKt.ChatMessageItem (cognitive 37) · ×1
  • IdeaKnowledgeContentKt.ChatMessageItem (cognitive 37) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:626 — IdeaKnowledgeContentKt.ChatMessageItem has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 5 (9 pts) (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 · WebEditChatInputKt.WebEditChatInput (cognitive 36) · ×1
  • WebEditChatInputKt.WebEditChatInput (cognitive 36) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditChatInput.kt:384 — WebEditChatInputKt.WebEditChatInput has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 10 (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 · IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent (cognitive 36) · ×1
  • IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent (cognitive 36) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:142 — IdeaMcpConfigDialogKt.IdeaMcpConfigDialogContent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 4 (8 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolOrchestrator.executeToolCall (cognitive 36) · ×1
  • ToolOrchestrator.executeToolCall (cognitive 36) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt:57 — ToolOrchestrator.executeToolCall has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (28 pts), error handling 3 (7 pts), 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 · ReviewMode.parseMarkdownFindings (cognitive 36) · ×1
  • ReviewMode.parseMarkdownFindings (cognitive 36) mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:323 — ReviewMode.parseMarkdownFindings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 7 (14 pts), boolean chains 2, loops 1 (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 · NodeReplRuntime.findBlockDeclarationEnd (cognitive 36) · ×1
  • NodeReplRuntime.findBlockDeclarationEnd (cognitive 36) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1593 — NodeReplRuntime.findBlockDeclarationEnd has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 5, 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 · IndentParser.parseForLoopWithMultilineIterable (cognitive 35) · ×1
  • IndentParser.parseForLoopWithMultilineIterable (cognitive 35) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:410 — IndentParser.parseForLoopWithMultilineIterable has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownInline.parse (cognitive 35) · ×1
  • MarkdownInline.parse (cognitive 35) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/text/MarkdownInline.kt:34 — MarkdownInline.parse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocQLSearchBarKt.DocQLSearchBar (cognitive 35) · ×1
  • DocQLSearchBarKt.DocQLSearchBar (cognitive 35) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocQLSearchBar.kt:22 — DocQLSearchBarKt.DocQLSearchBar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (23 pts), error handling 3 (5 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SessionRoutingKt.sessionRouting (cognitive 35) · ×1
  • SessionRoutingKt.sessionRouting (cognitive 35) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:23 — SessionRoutingKt.sessionRouting has cognitive complexity 35 (threshold 15). Drivers by points: if/else 32 (34 pts), error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DocQLResultFormatter.formatFallbackResult (cognitive 35) · ×1
  • DocQLResultFormatter.formatFallbackResult (cognitive 35) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:206 — DocQLResultFormatter.formatFallbackResult has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 6, match/switch 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 · jvmKt.FileViewerPanel (cognitive 34) · ×1
  • jvmKt.FileViewerPanel (cognitive 34) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:23 — jvmKt.FileViewerPanel has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), error handling 3 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiDatabaseChatDBExecutor.buildMultiDatabaseSchemaContext (cognitive 34) · ×1
  • MultiDatabaseChatDBExecutor.buildMultiDatabaseSchemaContext (cognitive 34) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:814 — MultiDatabaseChatDBExecutor.buildMultiDatabaseSchemaContext has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffParser.parse (cognitive 34) · ×1
  • DiffParser.parse (cognitive 34) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffModels.kt:46 — DiffParser.parse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (6 pts), boolean chains 4 (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 · NumericExprParser.parsePathToken (cognitive 33) · ×1
  • NumericExprParser.parsePathToken (cognitive 33) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:587 — NumericExprParser.parsePathToken has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (8 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatternActionFunc.from (cognitive 33) · ×1
  • PatternActionFunc.from (cognitive 33) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/action/PatternActionFunc.kt:192 — PatternActionFunc.from has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · JvmCodeParser.extractJsImports (cognitive 33) · ×1
  • JvmCodeParser.extractJsImports (cognitive 33) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:252 — JvmCodeParser.extractJsImports has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 3 (8 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 19). 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 · App.WebUiApp (cognitive 33) · ×1
  • App.WebUiApp (cognitive 33) mpp-web/src/App.tsx:7 — App.WebUiApp has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 18, if/else 6, error handling 4 (5 pts), ternaries 4 (nesting depth added 1). Of this number, 17 points are the body's own statements and 16 belong to 7 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 · BottomToolbarKt.BottomToolbar (cognitive 32) · ×1
  • BottomToolbarKt.BottomToolbar (cognitive 32) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/BottomToolbar.kt:25 — BottomToolbarKt.BottomToolbar has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodebaseInsightsTool.analyzeCodeStructure (cognitive 32) · ×1
  • CodebaseInsightsTool.analyzeCodeStructure (cognitive 32) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:341 — CodebaseInsightsTool.analyzeCodeStructure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 2 (6 pts), match/switch 1 (6 pts), loops 2 (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 · NanoExpressionEvaluator.evaluateStringExpressionOrNull (cognitive 31) · ×1
  • NanoExpressionEvaluator.evaluateStringExpressionOrNull (cognitive 31) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:203 — NanoExpressionEvaluator.evaluateStringExpressionOrNull has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 pts), boolean chains 6, 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 · androidKt.AndroidAutoDevContent (cognitive 31) · ×1
  • androidKt.AndroidAutoDevContent (cognitive 31) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:62 — androidKt.AndroidAutoDevContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), error handling 4 (9 pts), match/switch 2, 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 · LintExecutor.runLint (cognitive 31) · ×1
  • LintExecutor.runLint (cognitive 31) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/analysis/LintExecutor.kt:23 — LintExecutor.runLint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (8 pts), loops 2 (3 pts), error handling 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 · DocumentCli.main (cognitive 31) · ×1
  • DocumentCli.main (cognitive 31) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:38 — DocumentCli.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (21 pts), match/switch 4 (6 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CodeReviewAgentPromptRenderer.renderFixGenerationPrompt (cognitive 31) · ×1
  • CodeReviewAgentPromptRenderer.renderFixGenerationPrompt (cognitive 31) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgentPromptRenderer.kt:82 — CodeReviewAgentPromptRenderer.renderFixGenerationPrompt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StemmerState.step2 (cognitive 31) · ×1
  • StemmerState.step2 (cognitive 31) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:366 — StemmerState.step2 has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (29 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BaseDocQLExecutor.filterTocItems (cognitive 31) · ×1
  • BaseDocQLExecutor.filterTocItems (cognitive 31) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:192 — BaseDocQLExecutor.filterTocItems has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 11 (21 pts), if/else 10 (nesting depth added 10). 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 · MessageRenderer.ContentBlocks (cognitive 31) · ×1
  • MessageRenderer.ContentBlocks (cognitive 31) mpp-ui/src/jsMain/typescript/ui/MessageRenderer.tsx:332 — MessageRenderer.ContentBlocks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 12). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 346, 371, 399). 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 · codeFence.parseMarkdownContent (cognitive 31) · ×1
  • codeFence.parseMarkdownContent (cognitive 31) mpp-vscode/webview/src/utils/codeFence.ts:158 — codeFence.parseMarkdownContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 6, loops 1 (nesting depth added 13). 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 · appleKt.AppleAutoDevContent (cognitive 30) · ×1
  • appleKt.AppleAutoDevContent (cognitive 30) mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:57 — appleKt.AppleAutoDevContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), error handling 3 (7 pts), match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SketchRenderer.Render (cognitive 30) · ×1
  • SketchRenderer.Render (cognitive 30) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/SketchRenderer.kt:77 — SketchRenderer.Render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 4, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EditorUtilCopy.indentLine (cognitive 30) · ×1
  • EditorUtilCopy.indentLine (cognitive 30) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/presentation/EditorUtilCopy.kt:20 — EditorUtilCopy.indentLine has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomSSEProcessor.streamSSE (cognitive 30) · ×1
  • CustomSSEProcessor.streamSSE (cognitive 30) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt:71 — CustomSSEProcessor.streamSSE has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 4 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodebaseInsightsTool.analyzeGitHistory (cognitive 30) · ×1
  • CodebaseInsightsTool.analyzeGitHistory (cognitive 30) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:254 — CodebaseInsightsTool.analyzeGitHistory has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (7 pts), boolean chains 2, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModeCommandProcessor.process (cognitive 30) · ×1
  • ModeCommandProcessor.process (cognitive 30) mpp-ui/src/jsMain/typescript/processors/ModeCommandProcessor.ts:39 — ModeCommandProcessor.process has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitGraphBuilder.buildAsciiGraph (cognitive 29) · ×1
  • GitGraphBuilder.buildAsciiGraph (cognitive 29) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/GitGraphModel.kt:262 — GitGraphBuilder.buildAsciiGraph has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (6 pts), boolean chains 3, 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 · DocumentViewerPaneKt.DocumentViewerPane (cognitive 29) · ×1
  • DocumentViewerPaneKt.DocumentViewerPane (cognitive 29) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentViewerPane.kt:26 — DocumentViewerPaneKt.DocumentViewerPane has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 1, 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 · DomainDictDialogKt.DomainDictDialog (cognitive 29) · ×1
  • DomainDictDialogKt.DomainDictDialog (cognitive 29) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DomainDictDialog.kt:78 — DomainDictDialogKt.DomainDictDialog has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 7, error handling 3, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LayoutComponents.RenderHStack (cognitive 29) · ×1
  • LayoutComponents.RenderHStack (cognitive 29) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/layout/LayoutComponents.kt:80 — LayoutComponents.RenderHStack has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 10, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResponseBodyCallback.onResponse (cognitive 29) · ×1
  • ResponseBodyCallback.onResponse (cognitive 29) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/ResponseBodyCallback.kt:47 — ResponseBodyCallback.onResponse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (5 pts), boolean chains 3, error handling 2 (3 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 · FunctionStatementProcessor.evalValueByElementStmt (cognitive 29) · ×1
  • FunctionStatementProcessor.evalValueByElementStmt (cognitive 29) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:364 — FunctionStatementProcessor.evalValueByElementStmt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 17). 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 · ToolCallParser.parseKeyValueParametersCharByChar (cognitive 29) · ×1
  • ToolCallParser.parseKeyValueParametersCharByChar (cognitive 29) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/ToolCallParser.kt:197 — ToolCallParser.parseKeyValueParametersCharByChar has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (9 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcpClient.promptAndRender (cognitive 29) · ×1
  • AcpClient.promptAndRender (cognitive 29) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:234 — AcpClient.promptAndRender has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelConfigForm.ModelConfigForm (cognitive 29) · ×1
  • ModelConfigForm.ModelConfigForm (cognitive 29) mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx:42 — ModelConfigForm.ModelConfigForm has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (14 pts), match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (handleBack, handleModelSubmit, handleApiKeySubmit, …). 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 · CodexMode.handleInput (cognitive 29) · ×1
  • CodexMode.handleInput (cognitive 29) mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:105 — CodexMode.handleInput has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 11 (12 pts), boolean chains 3, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 209, 234, 187, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · codeFence.parseCodeBlocks (cognitive 29) · ×1
  • codeFence.parseCodeBlocks (cognitive 29) mpp-vscode/webview/src/utils/codeFence.ts:60 — codeFence.parseCodeBlocks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (10 pts), loops 4, boolean chains 1 (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoOptionParser.splitTopLevel (cognitive 28) · ×1
  • NanoOptionParser.splitTopLevel (cognitive 28) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/NanoPropsParser.kt:133 — NanoOptionParser.splitTopLevel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 6, 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 · FileSearchPopupKt.FileSearchPopup (cognitive 28) · ×1
  • FileSearchPopupKt.FileSearchPopup (cognitive 28) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:50 — FileSearchPopupKt.FileSearchPopup has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, error handling 2 (3 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 · CodeReviewAgent.generateFixes (cognitive 28) · ×1
  • CodeReviewAgent.generateFixes (cognitive 28) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgent.kt:198 — CodeReviewAgent.generateFixes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (27 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeFence.parseAll (cognitive 28) · ×1
  • CodeFence.parseAll (cognitive 28) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:112 — CodeFence.parseAll has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (3 pts), boolean chains 1, 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 · AutoDevAcpClient.sessionUpdate (cognitive 28) · ×1
  • AutoDevAcpClient.sessionUpdate (cognitive 28) mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:334 — AutoDevAcpClient.sessionUpdate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 12, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndentParser.collectStateDefaultValue (cognitive 27) · ×1
  • IndentParser.collectStateDefaultValue (cognitive 27) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:239 — IndentParser.collectStateDefaultValue has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TopBarMenuDesktopKt.TopBarMenuDesktop (cognitive 27) · ×1
  • TopBarMenuDesktopKt.TopBarMenuDesktop (cognitive 27) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:19 — TopBarMenuDesktopKt.TopBarMenuDesktop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24 (27 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 · TaskExecutionScreenKt.getEventInfo (cognitive 27) · ×1
  • TaskExecutionScreenKt.getEventInfo (cognitive 27) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:213 — TaskExecutionScreenKt.getEventInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · IdeaSketchRenderer.RenderResponse (cognitive 27) · ×1
  • IdeaSketchRenderer.RenderResponse (cognitive 27) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaSketchRenderer.kt:44 — IdeaSketchRenderer.RenderResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinterSummary.format (cognitive 27) · ×1
  • LinterSummary.format (cognitive 27) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:21 — LinterSummary.format has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobInvocation.findMatches (cognitive 27) · ×1
  • GlobInvocation.findMatches (cognitive 27) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:186 — GlobInvocation.findMatches has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocQLLexer.tokenize (cognitive 27) · ×1
  • DocQLLexer.tokenize (cognitive 27) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/DocQLLexer.kt:10 — DocQLLexer.tokenize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.App (cognitive 27) · ×1
  • App.App (cognitive 27) mpp-ui/src/jsMain/typescript/ui/App.tsx:26 — App.App has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 4 (7 pts), boolean chains 5, error handling 3 (nesting depth added 4). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 106, 43, 192, …). 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 · IndentParser.extractFirstRawArg (cognitive 26) · ×1
  • IndentParser.extractFirstRawArg (cognitive 26) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1680 — IndentParser.extractFirstRawArg has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 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 · MainKt.main (cognitive 26) · ×1
  • MainKt.main (cognitive 26) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/Main.kt:38 — MainKt.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (26 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DomainDictGenerateAction.cleanCsvOutput (cognitive 26) · ×1
  • DomainDictGenerateAction.cleanCsvOutput (cognitive 26) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/DomainDictGenerateAction.kt:153 — DomainDictGenerateAction.cleanCsvOutput has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, 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 · DiffParser.parseGitDiffBlock (cognitive 26) · ×1
  • DiffParser.parseGitDiffBlock (cognitive 26) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffModels.kt:126 — DiffParser.parseGitDiffBlock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckovLinter.parseCheckovOutput (cognitive 26) · ×1
  • CheckovLinter.parseCheckovOutput (cognitive 26) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/CheckovLinter.kt:28 — CheckovLinter.parseCheckovOutput has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 17). 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 · PlotDSLAgent.execute (cognitive 26) · ×1
  • PlotDSLAgent.execute (cognitive 26) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:61 — PlotDSLAgent.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), error handling 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 · DocumentRegistry.buildStructureTree (cognitive 26) · ×1
  • DocumentRegistry.buildStructureTree (cognitive 26) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/DocumentRegistry.kt:240 — DocumentRegistry.buildStructureTree has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (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 · JsDiffUtils.parseDiff (cognitive 26) · ×1
  • JsDiffUtils.parseDiff (cognitive 26) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt:357 — JsDiffUtils.parseDiff has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 17). 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 · QualityReviewPanelKt.TestNodeItem (cognitive 25) · ×1
  • QualityReviewPanelKt.TestNodeItem (cognitive 25) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/QualityReviewPanel.kt:334 — QualityReviewPanelKt.TestNodeItem has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (23 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, 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 · ImageAttachmentBarKt.ImageThumbnail (cognitive 25) · ×1
  • ImageAttachmentBarKt.ImageThumbnail (cognitive 25) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageAttachmentBar.kt:166 — ImageAttachmentBarKt.ImageThumbnail has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 5 (6 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 · KotlinTestContextProvider.isSpringRelated (cognitive 25) · ×1
  • KotlinTestContextProvider.isSpringRelated (cognitive 25) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:79 — KotlinTestContextProvider.isSpringRelated has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (4 pts), boolean chains 2, 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 · SemgrepLinter.parseSemgrepOutput (cognitive 25) · ×1
  • SemgrepLinter.parseSemgrepOutput (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SemgrepLinter.kt:29 — SemgrepLinter.parseSemgrepOutput has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (4 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 · ToolCallParser.parseToolCallFromDevinBlock (cognitive 25) · ×1
  • ToolCallParser.parseToolCallFromDevinBlock (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/ToolCallParser.kt:52 — ToolCallParser.parseToolCallFromDevinBlock has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2, 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 · GitIgnorePatternMatcher.patternToRegex (cognitive 25) · ×1
  • GitIgnorePatternMatcher.patternToRegex (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreFilter.kt:50 — GitIgnorePatternMatcher.patternToRegex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, match/switch 1 (2 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 · SelfHealingLocator.calculateSimilarity (cognitive 25) · ×1
  • SelfHealingLocator.calculateSimilarity (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/SelfHealingLocator.kt:90 — SelfHealingLocator.calculateSimilarity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (24 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 · BaseDocQLExecutor.filterEntities (cognitive 25) · ×1
  • BaseDocQLExecutor.filterEntities (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:278 — BaseDocQLExecutor.filterEntities has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 9 (19 pts), if/else 6 (nesting depth added 10). 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 · CodeDocQLExecutor.executeCodeClassesQuery (cognitive 25) · ×1
  • CodeDocQLExecutor.executeCodeClassesQuery (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:121 — CodeDocQLExecutor.executeCodeClassesQuery has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 9 (11 pts), loops 1 (nesting depth added 11). 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. This shape REPEATS in the file: one other method here (CodeDocQLExecutor.executeCodeFunctionsQuery) 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 · CodeDocQLExecutor.executeCodeFunctionsQuery (cognitive 25) · ×1
  • CodeDocQLExecutor.executeCodeFunctionsQuery (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:188 — CodeDocQLExecutor.executeCodeFunctionsQuery has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 9 (11 pts), loops 1 (nesting depth added 11). 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. This shape REPEATS in the file: one other method here (CodeDocQLExecutor.executeCodeClassesQuery) 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 · CodeFence.parse (cognitive 25) · ×1
  • CodeFence.parse (cognitive 25) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:22 — CodeFence.parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 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 · JvmCodeParser.extractPythonImports (cognitive 25) · ×1
  • JvmCodeParser.extractPythonImports (cognitive 25) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:153 — JvmCodeParser.extractPythonImports has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (7 pts), loops 3 (6 pts) (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 · ChatMode.handleInput (cognitive 25) · ×1
  • ChatMode.handleInput (cognitive 25) mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:69 — ChatMode.handleInput has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 9). Of this number, 23 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 · NodeReplRuntime.splitTopLevelDeclarators (cognitive 25) · ×1
  • NodeReplRuntime.splitTopLevelDeclarators (cognitive 25) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1929 — NodeReplRuntime.splitTopLevelDeclarators has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, 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 · IDEServer.start (cognitive 25) · ×1
  • IDEServer.start (cognitive 25) mpp-vscode/src/services/ide-server.ts:38 — IDEServer.start has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 8, boolean chains 4, error handling 4 (nesting depth added 4). None of this is in the body itself: all 25 points belong to 8 function literals inside it that branch (lines 105, 156, 122, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Omnibar.Omnibar (cognitive 25) · ×1
  • Omnibar.Omnibar (cognitive 25) mpp-vscode/webview/src/components/Omnibar.tsx:80 — Omnibar.Omnibar has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 9 (10 pts), ternaries 2 (3 pts), match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 204, 123, 145, …). 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 · IndentParser.parseComponentCall (cognitive 24) · ×1
  • IndentParser.parseComponentCall (cognitive 24) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:665 — IndentParser.parseComponentCall has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 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 · AcpRenderer.handleWriteFile (cognitive 24) · ×1
  • AcpRenderer.handleWriteFile (cognitive 24) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpRenderer.kt:187 — AcpRenderer.handleWriteFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jvmKt.ArtifactPreviewPanel (cognitive 24) · ×1
  • jvmKt.ArtifactPreviewPanel (cognitive 24) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:49 — jvmKt.ArtifactPreviewPanel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, 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 · ReviewCli.main (cognitive 24) · ×1
  • ReviewCli.main (cognitive 24) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:32 — ReviewCli.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), match/switch 2 (3 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · JavaLangDictProvider.collectLevel2 (cognitive 24) · ×1
  • JavaLangDictProvider.collectLevel2 (cognitive 24) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/indexer/provider/JavaLangDictProvider.kt:117 — JavaLangDictProvider.collectLevel2 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UrlParser.isValidHttpUrl (cognitive 24) · ×1
  • UrlParser.isValidHttpUrl (cognitive 24) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:59 — UrlParser.isValidHttpUrl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CamelCaseSplitter.split (cognitive 24) · ×1
  • CamelCaseSplitter.split (cognitive 24) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/naming/CamelCaseSplitter.kt:17 — CamelCaseSplitter.split has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, 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 · NodeReplRuntime.readVariableDeclaratorPattern (cognitive 24) · ×1
  • NodeReplRuntime.readVariableDeclaratorPattern (cognitive 24) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 — NodeReplRuntime.readVariableDeclaratorPattern has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, 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. This shape REPEATS in the file: one other method here (NodeReplRuntime.findTopLevelCharacter) 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 · NodeReplRuntime.findTopLevelCharacter (cognitive 24) · ×1
  • NodeReplRuntime.findTopLevelCharacter (cognitive 24) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1888 — NodeReplRuntime.findTopLevelCharacter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, 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. This shape REPEATS in the file: one other method here (NodeReplRuntime.readVariableDeclaratorPattern) 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 · index.runCodingAgent (cognitive 24) · ×1
  • index.runCodingAgent (cognitive 24) mpp-ui/src/jsMain/typescript/index.tsx:62 — index.runCodingAgent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 3 (4 pts), error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · index.runServerAgent (cognitive 24) · ×1
  • index.runServerAgent (cognitive 24) mpp-ui/src/jsMain/typescript/index.tsx:249 — index.runServerAgent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, error handling 3 (4 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolCallRenderer.ToolCallRenderer (cognitive 24) · ×1
  • ToolCallRenderer.ToolCallRenderer (cognitive 24) mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:15 — ToolCallRenderer.ToolCallRenderer has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, ternaries 5 (7 pts), if/else 2, error handling 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (formatParams, getStatusIcon, getStatusClass). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CodeAnalyzer.analyzeModifiedCode (cognitive 23) · ×1
  • CodeAnalyzer.analyzeModifiedCode (cognitive 23) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/analysis/CodeAnalyzer.kt:30 — CodeAnalyzer.analyzeModifiedCode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (5 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 · RoutingKt.configureRouting (cognitive 23) · ×1
  • RoutingKt.configureRouting (cognitive 23) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/Routing.kt:27 — RoutingKt.configureRouting has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 4, match/switch 4, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · GitLogParser.parse (cognitive 23) · ×1
  • GitLogParser.parse (cognitive 23) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitLogParser.kt:28 — GitLogParser.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, 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 · validate-scenarios.main (cognitive 23) · ×1
  • validate-scenarios.main (cognitive 23) mpp-ui/scripts/validate-scenarios.js:198 — validate-scenarios.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 2 (3 pts), ternaries 1 (3 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 · jvmKt.InspectDebugApp (cognitive 22) · ×1
  • jvmKt.InspectDebugApp (cognitive 22) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/WebViewDebugApp.jvm.kt:150 — jvmKt.InspectDebugApp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 2 (3 pts), boolean chains 2, match/switch 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 · E2ETestAgentDemoKt.runAIE2ETest (cognitive 22) · ×1
  • E2ETestAgentDemoKt.runAIE2ETest (cognitive 22) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/e2etest/E2ETestAgentDemo.kt:355 — E2ETestAgentDemoKt.runAIE2ETest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 2 (6 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 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 · IssueService.getIssueAsync (cognitive 22) · ×1
  • IssueService.getIssueAsync (cognitive 22) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/IssueService.kt:313 — IssueService.getIssueAsync has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · XiuperLaunchScreenKt.XiuperLaunchScreen (cognitive 22) · ×1
  • XiuperLaunchScreenKt.XiuperLaunchScreen (cognitive 22) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/launch/XiuperLaunchScreen.kt:48 — XiuperLaunchScreenKt.XiuperLaunchScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeedbackComponents.RenderModal (cognitive 22) · ×1
  • FeedbackComponents.RenderModal (cognitive 22) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/feedback/FeedbackComponents.kt:51 — FeedbackComponents.RenderModal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoginScreenKt.LoginScreen (cognitive 22) · ×1
  • LoginScreenKt.LoginScreen (cognitive 22) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/LoginScreen.kt:26 — LoginScreenKt.LoginScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LLMProviderAdapter.stream (cognitive 22) · ×1
  • LLMProviderAdapter.stream (cognitive 22) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:106 — LLMProviderAdapter.stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, 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, 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 · MCPService.parseArgs (cognitive 22) · ×1
  • MCPService.parseArgs (cognitive 22) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/host/HostMCPService.kt:105 — MCPService.parseArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdeaTopToolbarKt.IdeaTopToolbar (cognitive 22) · ×1
  • IdeaTopToolbarKt.IdeaTopToolbar (cognitive 22) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:45 — IdeaTopToolbarKt.IdeaTopToolbar 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 · JewelRenderer.updatePlanState (cognitive 22) · ×1
  • JewelRenderer.updatePlanState (cognitive 22) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:376 — JewelRenderer.updatePlanState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · StemmerState.m (cognitive 22) · ×1
  • StemmerState.m (cognitive 22) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:276 — StemmerState.m has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StemmerState.step1 (cognitive 22) · ×1
  • StemmerState.step1 (cognitive 22) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:345 — StemmerState.step1 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChartAgent.execute (cognitive 22) · ×1
  • ChartAgent.execute (cognitive 22) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:50 — ChartAgent.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FrontMatterProcessor.processFrontMatter (cognitive 22) · ×1
  • FrontMatterProcessor.processFrontMatter (cognitive 22) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/FrontMatterProcessor.kt:33 — FrontMatterProcessor.processFrontMatter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (8 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 · DefaultFileSystem.searchFilesRecursive (cognitive 22) · ×1
  • DefaultFileSystem.searchFilesRecursive (cognitive 22) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.js.kt:194 — DefaultFileSystem.searchFilesRecursive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 2 (3 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 · PlanSummaryBar.PlanSummaryBar (cognitive 22) · ×1
  • PlanSummaryBar.PlanSummaryBar (cognitive 22) mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:47 — PlanSummaryBar.PlanSummaryBar has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (6 pts), boolean chains 5, match/switch 2, ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (findCurrentStep, getStatusIcon, getStatusClass). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · JvmMcpBackend.stat (cognitive 21) · ×1
  • JvmMcpBackend.stat (cognitive 21) xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.jvm.kt:28 — JvmMcpBackend.stat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 6). 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 · DataSourceConfigPaneKt.DataSourceConfigPane (cognitive 21) · ×1
  • DataSourceConfigPaneKt.DataSourceConfigPane (cognitive 21) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:29 — DataSourceConfigPaneKt.DataSourceConfigPane has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · QualityReviewPanelKt.TestFileCard (cognitive 21) · ×1
  • QualityReviewPanelKt.TestFileCard (cognitive 21) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/QualityReviewPanel.kt:165 — QualityReviewPanelKt.TestFileCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DiffFileTreeViewKt.buildFileTreeStructure (cognitive 21) · ×1
  • DiffFileTreeViewKt.buildFileTreeStructure (cognitive 21) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:173 — DiffFileTreeViewKt.buildFileTreeStructure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommandResolverKt.resolveCommand (cognitive 21) · ×1
  • CommandResolverKt.resolveCommand (cognitive 21) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/client/CommandResolver.kt:9 — CommandResolverKt.resolveCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 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 · IdeaAcpAgentContentKt.AgentDropdown (cognitive 21) · ×1
  • IdeaAcpAgentContentKt.AgentDropdown (cognitive 21) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:224 — IdeaAcpAgentContentKt.AgentDropdown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitWorkspaceSnapshot.diff (cognitive 21) · ×1
  • GitWorkspaceSnapshot.diff (cognitive 21) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/GitWorkspaceSnapshot.kt:47 — GitWorkspaceSnapshot.diff has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, match/switch 1 (3 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 · DevInsParser.parseUsed (cognitive 21) · ×1
  • DevInsParser.parseUsed (cognitive 21) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:391 — DevInsParser.parseUsed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (5 pts), boolean chains 1, 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 · ImportDependencyClusterer.buildDependencyGraph (cognitive 21) · ×1
  • ImportDependencyClusterer.buildDependencyGraph (cognitive 21) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:87 — ImportDependencyClusterer.buildDependencyGraph has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcpClient.renderSessionUpdate (cognitive 21) · ×1
  • AcpClient.renderSessionUpdate (cognitive 21) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:641 — AcpClient.renderSessionUpdate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ServerAgentClient.executeStream (cognitive 21) · ×1
  • ServerAgentClient.executeStream (cognitive 21) mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:85 — ServerAgentClient.executeStream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 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 · ServerRenderer.formatToolCallDisplay (cognitive 21) · ×1
  • ServerRenderer.formatToolCallDisplay (cognitive 21) mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:282 — ServerRenderer.formatToolCallDisplay has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), ternaries 2 (4 pts), error handling 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 · SlashCommandProcessor.handleDeepResearchCommand (cognitive 21) · ×1
  • SlashCommandProcessor.handleDeepResearchCommand (cognitive 21) mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:374 — SlashCommandProcessor.handleDeepResearchCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NanoColorUtils.generateFromSeed (cognitive 20) · ×1
  • NanoColorUtils.generateFromSeed (cognitive 20) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/theme/NanoColorUtils.kt:103 — NanoColorUtils.generateFromSeed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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 · ModificationPlanSectionKt.ModificationPlanSection (cognitive 20) · ×1
  • ModificationPlanSectionKt.ModificationPlanSection (cognitive 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:83 — ModificationPlanSectionKt.ModificationPlanSection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DesktopTitleBarTabsKt.DesktopTitleBarTabs (cognitive 20) · ×1
  • DesktopTitleBarTabsKt.DesktopTitleBarTabs (cognitive 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/DesktopTitleBarTabs.kt:28 — DesktopTitleBarTabsKt.DesktopTitleBarTabs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 1, 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 · CloudStorageConfigDialogKt.CloudStorageConfigDialog (cognitive 20) · ×1
  • CloudStorageConfigDialogKt.CloudStorageConfigDialog (cognitive 20) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/CloudStorageConfigDialog.kt:27 — CloudStorageConfigDialogKt.CloudStorageConfigDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 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 · ReviewCli.extractFilePathsFromPatch (cognitive 20) · ×1
  • ReviewCli.extractFilePathsFromPatch (cognitive 20) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:268 — ReviewCli.extractFilePathsFromPatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (17 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 · CmdWrapper.findBinary (cognitive 20) · ×1
  • CmdWrapper.findBinary (cognitive 20) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/linecount/CmdWrapper.kt:54 — CmdWrapper.findBinary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, error handling 1, loops 1, match/switch 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 · LLMDialog.doOKAction (cognitive 20) · ×1
  • LLMDialog.doOKAction (cognitive 20) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:332 — LLMDialog.doOKAction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 6, boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · NanoDSLValidator.performBasicValidation (cognitive 20) · ×1
  • NanoDSLValidator.performBasicValidation (cognitive 20) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:106 — NanoDSLValidator.performBasicValidation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DomainDictAgent.parseHotFilesWithTreeSitter (cognitive 20) · ×1
  • DomainDictAgent.parseHotFilesWithTreeSitter (cognitive 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/DomainDictAgent.kt:464 — DomainDictAgent.parseHotFilesWithTreeSitter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UrlParser.parsePrompt (cognitive 20) · ×1
  • UrlParser.parsePrompt (cognitive 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:18 — UrlParser.parsePrompt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleDslParser.parseAction (cognitive 20) · ×1
  • SimpleDslParser.parseAction (cognitive 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:560 — SimpleDslParser.parseAction has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MarkdownDocQLExecutor.filterTables (cognitive 20) · ×1
  • MarkdownDocQLExecutor.filterTables (cognitive 20) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:523 — MarkdownDocQLExecutor.filterTables has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 7 (nesting depth added 6). 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 · NodeJsArtifactExecutor.validate (cognitive 20) · ×1
  • NodeJsArtifactExecutor.validate (cognitive 20) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:24 — NodeJsArtifactExecutor.validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, 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 · TikaDocumentParser.buildSimpleChunks (cognitive 20) · ×1
  • TikaDocumentParser.buildSimpleChunks (cognitive 20) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/TikaDocumentParser.kt:111 — TikaDocumentParser.buildSimpleChunks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 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 · IndentParser.parseActionBlock (cognitive 19) · ×1
  • IndentParser.parseActionBlock (cognitive 19) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:870 — IndentParser.parseActionBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoStateRuntime.coerceSetValue (cognitive 19) · ×1
  • NanoStateRuntime.coerceSetValue (cognitive 19) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:200 — NanoStateRuntime.coerceSetValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ComposeRenderer.updatePlanState (cognitive 19) · ×1
  • ComposeRenderer.updatePlanState (cognitive 19) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:503 — ComposeRenderer.updatePlanState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ChatDBChatPaneKt.ConnectionStatusBanner (cognitive 19) · ×1
  • ChatDBChatPaneKt.ConnectionStatusBanner (cognitive 19) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:94 — ChatDBChatPaneKt.ConnectionStatusBanner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FileChangeSummaryKt.FileChangeSummary (cognitive 19) · ×1
  • FileChangeSummaryKt.FileChangeSummary (cognitive 19) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:34 — FileChangeSummaryKt.FileChangeSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 3, match/switch 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DateComponents.RenderDateRangePicker (cognitive 19) · ×1
  • DateComponents.RenderDateRangePicker (cognitive 19) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:121 — DateComponents.RenderDateRangePicker has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateProjectDialogKt.CreateProjectDialog (cognitive 19) · ×1
  • CreateProjectDialogKt.CreateProjectDialog (cognitive 19) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:22 — CreateProjectDialogKt.CreateProjectDialog has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, error handling 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 · SketchToolWindow.onUpdate (cognitive 19) · ×1
  • SketchToolWindow.onUpdate (cognitive 19) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:315 — SketchToolWindow.onUpdate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionStatementProcessor.executeComparison (cognitive 19) · ×1
  • FunctionStatementProcessor.executeComparison (cognitive 19) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/FunctionStatementProcessor.kt:199 — FunctionStatementProcessor.executeComparison has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, match/switch 1 (nesting depth added 4). 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 · CodeReviewAgentPromptRenderer.formatIssuesByContext (cognitive 19) · ×1
  • CodeReviewAgentPromptRenderer.formatIssuesByContext (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgentPromptRenderer.kt:353 — CodeReviewAgentPromptRenderer.formatIssuesByContext 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, 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 · CodingAgentExecutor.execute (cognitive 19) · ×1
  • CodingAgentExecutor.execute (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:85 — CodingAgentExecutor.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentAgentExecutor.executeToolCalls (cognitive 19) · ×1
  • DocumentAgentExecutor.executeToolCalls (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:195 — DocumentAgentExecutor.executeToolCalls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 1 (2 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 · SimpleDslParser.parse (cognitive 19) · ×1
  • SimpleDslParser.parse (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:465 — SimpleDslParser.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownDocQLExecutor.filterCodeBlocks (cognitive 19) · ×1
  • MarkdownDocQLExecutor.filterCodeBlocks (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:336 — MarkdownDocQLExecutor.filterCodeBlocks has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 6 (nesting depth added 6). 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 · MarkdownDocQLExecutor.extractTables (cognitive 19) · ×1
  • MarkdownDocQLExecutor.extractTables (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:453 — MarkdownDocQLExecutor.extractTables has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, 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 · DevInsLexer.tokenizeContent (cognitive 19) · ×1
  • DevInsLexer.tokenizeContent (cognitive 19) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:117 — DevInsLexer.tokenizeContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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 · renderUtils.parseCodeBlocksSync (cognitive 19) · ×1
  • renderUtils.parseCodeBlocksSync (cognitive 19) mpp-ui/src/jsMain/typescript/utils/renderUtils.ts:70 — renderUtils.parseCodeBlocksSync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileSearchPopup.FileSearchPopup (cognitive 19) · ×1
  • FileSearchPopup.FileSearchPopup (cognitive 19) mpp-vscode/webview/src/components/FileSearchPopup.tsx:58 — FileSearchPopup.FileSearchPopup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, match/switch 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 79, 92, 112, …). 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 · ArtifactMessageListKt.ArtifactMessageList (cognitive 18) · ×1
  • ArtifactMessageListKt.ArtifactMessageList (cognitive 18) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactMessageList.kt:33 — ArtifactMessageListKt.ArtifactMessageList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3, 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 · EditApply.skipToNextRelevantLine (cognitive 18) · ×1
  • EditApply.skipToNextRelevantLine (cognitive 18) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/EditApply.kt:137 — EditApply.skipToNextRelevantLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 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 · DomainDictionary.toGroupedFormat (cognitive 18) · ×1
  • DomainDictionary.toGroupedFormat (cognitive 18) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/model/DomainDictionary.kt:93 — DomainDictionary.toGroupedFormat has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (8 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CustomLLMProvider.stream (cognitive 18) · ×1
  • CustomLLMProvider.stream (cognitive 18) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt:54 — CustomLLMProvider.stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LLMDialog.testConnection (cognitive 18) · ×1
  • LLMDialog.testConnection (cognitive 18) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:201 — LLMDialog.testConnection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 5, boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ShellUtil.detectShells (cognitive 18) · ×1
  • ShellUtil.detectShells (cognitive 18) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/run/ShellUtil.kt:22 — ShellUtil.detectShells has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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 · IdeaFileSearchPopupKt.searchAllItems (cognitive 18) · ×1
  • IdeaFileSearchPopupKt.searchAllItems (cognitive 18) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:481 — IdeaFileSearchPopupKt.searchAllItems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodingAgent.buildContext (cognitive 18) · ×1
  • CodingAgent.buildContext (cognitive 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgent.kt:310 — CodingAgent.buildContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AgentContextDiscovery.discoverContextFiles (cognitive 18) · ×1
  • AgentContextDiscovery.discoverContextFiles (cognitive 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/context/AgentContextDiscovery.kt:55 — AgentContextDiscovery.discoverContextFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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 · BaseGitIgnoreParser.isIgnored (cognitive 18) · ×1
  • BaseGitIgnoreParser.isIgnored (cognitive 18) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.kt:116 — BaseGitIgnoreParser.isIgnored has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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 · JsLinterSummary.format (cognitive 18) · ×1
  • JsLinterSummary.format (cognitive 18) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:143 — JsLinterSummary.format has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AcpClient.handleToolCallEvent (cognitive 18) · ×1
  • AcpClient.handleToolCallEvent (cognitive 18) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/acp/AcpClient.kt:787 — AcpClient.handleToolCallEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 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, 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 · JvmCodeParser.extractGoImports (cognitive 18) · ×1
  • JvmCodeParser.extractGoImports (cognitive 18) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:365 — JvmCodeParser.extractGoImports has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ReviewMode.displayKotlinFindings (cognitive 18) · ×1
  • ReviewMode.displayKotlinFindings (cognitive 18) mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:496 — ReviewMode.displayKotlinFindings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (formatFinding, a function literal at line 504, a function literal at line 530). 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 · IndentParser.parseFetchLine (cognitive 17) · ×1
  • IndentParser.parseFetchLine (cognitive 17) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:978 — IndentParser.parseFetchLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndentParser.createNode (cognitive 17) · ×1
  • IndentParser.createNode (cognitive 17) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1209 — IndentParser.createNode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). 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 · NanoStateRuntime.applyStateMutation (cognitive 17) · ×1
  • NanoStateRuntime.applyStateMutation (cognitive 17) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:146 — NanoStateRuntime.applyStateMutation has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 6 (8 pts) (nesting depth added 6). 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 · ComposeRenderer.renderToolCallInternal (cognitive 17) · ×1
  • ComposeRenderer.renderToolCallInternal (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:308 — ComposeRenderer.renderToolCallInternal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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 · ToolCallItemKt.TerminalOutputItem (cognitive 17) · ×1
  • ToolCallItemKt.TerminalOutputItem (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolCallItem.kt:469 — ToolCallItemKt.TerminalOutputItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, match/switch 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 · ToolItemKt.CurrentToolCallItem (cognitive 17) · ×1
  • ToolItemKt.CurrentToolCallItem (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ToolItem.kt:314 — ToolItemKt.CurrentToolCallItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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 · ArtifactCodeBlockKt.ArtifactCodeBlock (cognitive 17) · ×1
  • ArtifactCodeBlockKt.ArtifactCodeBlock (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactCodeBlock.kt:31 — ArtifactCodeBlockKt.ArtifactCodeBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ArtifactPageKt.ArtifactPage (cognitive 17) · ×1
  • ArtifactPageKt.ArtifactPage (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPage.kt:49 — ArtifactPageKt.ArtifactPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6 (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 · ThinkingBlockRendererKt.ThinkingBlockRenderer (cognitive 17) · ×1
  • ThinkingBlockRendererKt.ThinkingBlockRenderer (cognitive 17) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/ThinkingBlockRenderer.kt:25 — ThinkingBlockRendererKt.ThinkingBlockRenderer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CodeFence.parse (cognitive 17) · ×1
  • CodeFence.parse (cognitive 17) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:18 — CodeFence.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeFence.parseAll (cognitive 17) · ×1
  • CodeFence.parseAll (cognitive 17) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:76 — CodeFence.parseAll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostCodeProcessor.execute (cognitive 17) · ×1
  • PostCodeProcessor.execute (cognitive 17) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/PostCodeProcessor.kt:15 — PostCodeProcessor.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdeaOmnibarDialogKt.IdeaOmnibarContent (cognitive 17) · ×1
  • IdeaOmnibarDialogKt.IdeaOmnibarContent (cognitive 17) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDialog.kt:90 — IdeaOmnibarDialogKt.IdeaOmnibarContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 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 · ExternalCliCodingAgent.buildCommand (cognitive 17) · ×1
  • ExternalCliCodingAgent.buildCommand (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:160 — ExternalCliCodingAgent.buildCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (5 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RuffLinter.parseRuffOutput (cognitive 17) · ×1
  • RuffLinter.parseRuffOutput (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/RuffLinter.kt:29 — RuffLinter.parseRuffOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefaultCodingAgentRenderer.renderToolResult (cognitive 17) · ×1
  • DefaultCodingAgentRenderer.renderToolResult (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:117 — DefaultCodingAgentRenderer.renderToolResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DomainDictAgent.extractMeaningfulNames (cognitive 17) · ×1
  • DomainDictAgent.extractMeaningfulNames (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/DomainDictAgent.kt:362 — DomainDictAgent.extractMeaningfulNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodebaseInsightsTool.analyzeImports (cognitive 17) · ×1
  • CodebaseInsightsTool.analyzeImports (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:413 — CodebaseInsightsTool.analyzeImports has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), boolean chains 2, error handling 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 · ChangedCodeExtractor.extractCodeHunk (cognitive 17) · ×1
  • ChangedCodeExtractor.extractCodeHunk (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/ChangedCodeExtractor.kt:110 — ChangedCodeExtractor.extractCodeHunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2, match/switch 1 (2 pts), 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 · CodeDocQLExecutor.executeContentQuery (cognitive 17) · ×1
  • CodeDocQLExecutor.executeContentQuery (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:18 — CodeDocQLExecutor.executeContentQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (2 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 · CodeDocQLExecutor.executeCodeCustomQuery (cognitive 17) · ×1
  • CodeDocQLExecutor.executeCodeCustomQuery (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:415 — CodeDocQLExecutor.executeCodeCustomQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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 · DocQLParser.parseFilterCondition (cognitive 17) · ×1
  • DocQLParser.parseFilterCondition (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/DocQLParser.kt:99 — DocQLParser.parseFilterCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, match/switch 5 (8 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MarkdownCode.parse (cognitive 17) · ×1
  • MarkdownCode.parse (cognitive 17) mpp-core/src/commonMain/kotlin/cc/unitmesh/utils/MarkdownCode.kt:5 — MarkdownCode.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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 · JsDiffUtils.extractFilePaths (cognitive 17) · ×1
  • JsDiffUtils.extractFilePaths (cognitive 17) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodeReviewAgentExports.kt:406 — JsDiffUtils.extractFilePaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (2 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 · ParagraphPdfDocumentReader.getTextBetweenParagraphs (cognitive 17) · ×1
  • ParagraphPdfDocumentReader.getTextBetweenParagraphs (cognitive 17) mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/pdf/ParagraphPdfDocumentReader.kt:132 — ParagraphPdfDocumentReader.getTextBetweenParagraphs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultimodalLLMService.streamImageUnderstanding (cognitive 17) · ×1
  • MultimodalLLMService.streamImageUnderstanding (cognitive 17) mpp-core/src/jvmMain/kotlin/cc/unitmesh/llm/multimodal/MultimodalLLMService.kt:59 — MultimodalLLMService.streamImageUnderstanding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (3 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 · publish-remote.main (cognitive 17) · ×1
  • publish-remote.main (cognitive 17) mpp-ui/scripts/publish-remote.js:44 — publish-remote.main has cognitive complexity 17 (threshold 15). Drivers by points: error handling 7 (8 pts), if/else 6, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · index.t (cognitive 17) · ×1
  • index.t (cognitive 17) mpp-ui/src/jsMain/typescript/i18n/index.ts:81 — index.t has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NanoState.mutate (cognitive 16) · ×1
  • NanoState.mutate (cognitive 16) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoState.kt:174 — NanoState.mutate has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 4). 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 · DbFsBackend.list (cognitive 16) · ×1
  • DbFsBackend.list (cognitive 16) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/db/DbFsBackend.kt:28 — DbFsBackend.list 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 · FsPathPattern.match (cognitive 16) · ×1
  • FsPathPattern.match (cognitive 16) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/http/RestFs.kt:393 — FsPathPattern.match 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 · CodeReviewAgentPanelKt.CodeReviewAgentPanel (cognitive 16) · ×1
  • CodeReviewAgentPanelKt.CodeReviewAgentPanel (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:57 — CodeReviewAgentPanelKt.CodeReviewAgentPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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 · ModificationPlanSectionKt.PlanItemCard (cognitive 16) · ×1
  • ModificationPlanSectionKt.PlanItemCard (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:236 — ModificationPlanSectionKt.PlanItemCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, match/switch 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 · GitGraphBuilder.buildGraph (cognitive 16) · ×1
  • GitGraphBuilder.buildGraph (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/GitGraphModel.kt:91 — GitGraphBuilder.buildGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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 · AcpAgentConfigDialogKt.AcpAgentConfigDialog (cognitive 16) · ×1
  • AcpAgentConfigDialogKt.AcpAgentConfigDialog (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:28 — AcpAgentConfigDialogKt.AcpAgentConfigDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · TopToolbarKt.TopToolbar (cognitive 16) · ×1
  • TopToolbarKt.TopToolbar (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/TopToolbar.kt:25 — TopToolbarKt.TopToolbar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · DiffSketchRenderer.HunkView (cognitive 16) · ×1
  • DiffSketchRenderer.HunkView (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DiffSketchRenderer.kt:316 — DiffSketchRenderer.HunkView has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AnsiParser.parse (cognitive 16) · ×1
  • AnsiParser.parse (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/AnsiParser.kt:60 — AnsiParser.parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 2, match/switch 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 · CreateSessionDialogKt.CreateSessionDialog (cognitive 16) · ×1
  • CreateSessionDialogKt.CreateSessionDialog (cognitive 16) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:32 — CreateSessionDialogKt.CreateSessionDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 2, boolean chains 1, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RipgrepSearcher.findRipgrepBinaryOnUnix (cognitive 16) · ×1
  • RipgrepSearcher.findRipgrepBinaryOnUnix (cognitive 16) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:105 — RipgrepSearcher.findRipgrepBinaryOnUnix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMModelManager.updateAllDropdowns (cognitive 16) · ×1
  • LLMModelManager.updateAllDropdowns (cognitive 16) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/model/LLMModelManager.kt:215 — LLMModelManager.updateAllDropdowns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 1 (2 pts), boolean chains 1, loops 1, match/switch 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 · Statement.display (cognitive 16) · ×1
  • Statement.display (cognitive 16) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/ShireExpression.kt:13 — Statement.display has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (3 pts) (nesting depth added 5). 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 · IdeaDatabaseConnection.getSchema (cognitive 16) · ×1
  • IdeaDatabaseConnection.getSchema (cognitive 16) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:176 — IdeaDatabaseConnection.getSchema has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (11 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdeaLiveTerminalBubbleKt.IdeaLiveTerminalBubble (cognitive 16) · ×1
  • IdeaLiveTerminalBubbleKt.IdeaLiveTerminalBubble (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaLiveTerminalBubble.kt:153 — IdeaLiveTerminalBubbleKt.IdeaLiveTerminalBubble has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 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 · IdeaModelConfigDialogKt.IdeaModelConfigDialogContent (cognitive 16) · ×1
  • IdeaModelConfigDialogKt.IdeaModelConfigDialogContent (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:63 — IdeaModelConfigDialogKt.IdeaModelConfigDialogContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · IdeaCodeBlockRendererKt.CodeBlockToolbar (cognitive 16) · ×1
  • IdeaCodeBlockRendererKt.CodeBlockToolbar (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaCodeBlockRenderer.kt:60 — IdeaCodeBlockRendererKt.CodeBlockToolbar 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 · IdeaDevInBlockRendererKt.IdeaDevInToolItem (cognitive 16) · ×1
  • IdeaDevInBlockRendererKt.IdeaDevInToolItem (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDevInBlockRenderer.kt:89 — IdeaDevInBlockRendererKt.IdeaDevInToolItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · IdeaKnowledgeContentKt.DocumentContentPanel (cognitive 16) · ×1
  • IdeaKnowledgeContentKt.DocumentContentPanel (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:316 — IdeaKnowledgeContentKt.DocumentContentPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdeaKnowledgeContentKt.AIChatPanel (cognitive 16) · ×1
  • IdeaKnowledgeContentKt.AIChatPanel (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:464 — IdeaKnowledgeContentKt.AIChatPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdeaWebEditContentKt.WebEditChatPanel (cognitive 16) · ×1
  • IdeaWebEditContentKt.WebEditChatPanel (cognitive 16) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:473 — IdeaWebEditContentKt.WebEditChatPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeReviewAgentExecutor.executeToolCalls (cognitive 16) · ×1
  • CodeReviewAgentExecutor.executeToolCalls (cognitive 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:162 — CodeReviewAgentExecutor.executeToolCalls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 1 (2 pts), 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 · ToolOrchestrator.parseStepsParameter (cognitive 16) · ×1
  • ToolOrchestrator.parseStepsParameter (cognitive 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/orchestrator/ToolOrchestrator.kt:754 — ToolOrchestrator.parseStepsParameter has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 5, error handling 1 (2 pts) (nesting depth added 6). 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 · LLMRunConfigAnalyzer.gatherProjectContext (cognitive 16) · ×1
  • LLMRunConfigAnalyzer.gatherProjectContext (cognitive 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/runconfig/LLMRunConfigAnalyzer.kt:126 — LLMRunConfigAnalyzer.gatherProjectContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 2 (4 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 · DocumentRegistry.buildPathTree (cognitive 16) · ×1
  • DocumentRegistry.buildPathTree (cognitive 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/DocumentRegistry.kt:527 — DocumentRegistry.buildPathTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownDocQLExecutor.executeHeadingQuery (cognitive 16) · ×1
  • MarkdownDocQLExecutor.executeHeadingQuery (cognitive 16) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:137 — MarkdownDocQLExecutor.executeHeadingQuery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 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 · ExposedDatabaseConnection.getSchema (cognitive 16) · ×1
  • ExposedDatabaseConnection.getSchema (cognitive 16) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:183 — ExposedDatabaseConnection.getSchema has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (11 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WasmJsCodeParser.buildRelationships (cognitive 16) · ×1
  • WasmJsCodeParser.buildRelationships (cognitive 16) mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:310 — WasmJsCodeParser.buildRelationships has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), match/switch 2 (5 pts), error handling 1 (2 pts), loops 1 (2 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 · AcpAgentServer.classifyToolKind (cognitive 16) · ×1
  • AcpAgentServer.classifyToolKind (cognitive 16) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:194 — AcpAgentServer.classifyToolKind has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AgentMode.handleInput (cognitive 16) · ×1
  • AgentMode.handleInput (cognitive 16) mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:127 — AgentMode.handleInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (5 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 3). 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 · index.main (cognitive 16) · ×1
  • index.main (cognitive 16) mpp-ui/src/jsMain/typescript/index.tsx:437 — index.main has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (5 pts), if/else 4 (nesting depth added 1). None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 467, 543, 511, …). 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 · mermaid.html.renderMermaid (cognitive 16) · ×1
  • mermaid.html.renderMermaid (cognitive 16) mpp-viewer-web/src/commonMain/resources/mermaid.html:202 — mermaid.html.renderMermaid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, error handling 1 (nesting depth added 3). 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 · AutoDevCodeLensProvider.buildCodeLensGroups (cognitive 16) · ×1
  • AutoDevCodeLensProvider.buildCodeLensGroups (cognitive 16) mpp-vscode/src/providers/codelens-provider.ts:97 — AutoDevCodeLensProvider.buildCodeLensGroups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReactStateContext.mutate (cognitive 16) · ×1
  • ReactStateContext.mutate (cognitive 16) mpp-vscode/webview/src/components/nano/NanoActionHandler.ts:266 — ReactStateContext.mutate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 4). 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.
D22 · Internal API Consistency · Ambiguous global connection state vs specific server state. `isConnected` implies a single boolean state for the manager, but the manager can manage multiple servers (as seen in `MCPConfig` and `discoverServerTools`). It is unclear if `isConnected` returns true if *any* server is connected, *all* servers are connected, or if it refers to the underlying transport connection. · ×1
  • Ambiguous global connection state vs specific server state. `isConnected` implies a single boolean state for the manager, but the manager can manage multiple servers (as seen in `MCPConfig` and `discoverServerTools`). It is unclear if `isConnected` returns true if *any* server is connected, *all* servers are connected, or if it refers to the underlying transport connection. — Rename `isConnected` to `isTransportConnected` (if it refers to the socket/IPC) or remove it in favor of `getServerStatuses()` which provides granular status. If a global 'ready' state is needed, name it `isReady` and define its semantics clearly. (signatures: MCPManager.isConnected: Bool | MCPManager.isServerConnected(String): Bool)
D22 · Internal API Consistency · Redundant or overlapping state reporting. `connectionStatus` is a String (likely 'connected', 'disconnected', 'error'), while `lastError` captures error details. If `connectionStatus` can be 'error', it duplicates the presence of `lastError`. If `connectionStatus` is purely transport-level, it should be named `transportState` to distinguish from logical connection status. · ×1
  • Redundant or overlapping state reporting. `connectionStatus` is a String (likely 'connected', 'disconnected', 'error'), while `lastError` captures error details. If `connectionStatus` can be 'error', it duplicates the presence of `lastError`. If `connectionStatus` is purely transport-level, it should be named `transportState` to distinguish from logical connection status. — If `connectionStatus` is a human-readable summary, consider removing it in favor of a typed enum `ConnectionState` and relying on `lastError` for details. Or rename `connectionStatus` to `transportState` to clarify it is low-level. (signatures: MCPManager.connectionStatus: String | MCPManager.lastError: String?)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 29 shared lines) · ×1
  • Near-duplicate member family (5 members, 29 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:18 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:18-58 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:17-59 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:17-59 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:18-58 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:17-59 — These 5 members are variants of one another: a block of 29 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them 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 · Near-duplicate member family (3 members, 276 shared lines) · ×1
  • Near-duplicate member family (3 members, 276 shared lines) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:27 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:27-383 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:27-383 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:27-392 — These 3 members are variants of one another: a block of 276 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 52 shared lines) · ×1
  • Near-duplicate member family (3 members, 52 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:25 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:25-245 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:35-377 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:27-228 — These 3 members are variants of one another: a block of 52 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 20 shared lines) · ×1
  • Near-duplicate member family (3 members, 20 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:36 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:36-58 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt:38-60 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:36-58 — These 3 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member pair (141 shared lines) · ×1
  • Near-duplicate member pair (141 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:66 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:66-318 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:61-323 — These two members are variants of one another: 141 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 · Near-duplicate member pair (87 shared lines) · ×1
  • Near-duplicate member pair (87 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:145 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:145-511 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:38-417 — These two members are variants of one another: 87 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 · Near-duplicate member pair (84 shared lines) · ×1
  • Near-duplicate member pair (84 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:472 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:472-620 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:481-641 — These two members are variants of one another: 84 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 · Near-duplicate member pair (83 shared lines) · ×1
  • Near-duplicate member pair (83 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:26 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:26-178 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:29-378 — These two members are variants of one another: 83 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 · Near-duplicate member pair (65 shared lines) · ×1
  • Near-duplicate member pair (65 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:880 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:880-951 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1018-1095 — These two members are variants of one another: 65 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 · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:135 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:135-186 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchToolWindow.kt:315-378 — These two members are variants of one another: 40 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 · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:55 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt:55-99 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/InlayPanel.kt:45-89 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:809 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:809-874 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:937-1009 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×1
  • Edited copy of a member (20 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:241 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:241-264 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:267-294 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:19 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:19-55 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:21-55 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:60 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:60-86 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:88-120 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:61-87 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:89-121 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:61-87 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:89-121 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:60-86 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:88-120 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:61-87 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:89-121 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:43 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:43-290 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:34-185 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:28-156 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:38-306 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DomainDictCli.kt:197-210 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:118-184 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:32-239 — These 7 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 7 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 7 times.
D4 · Code Duplication · Duplicated block (144–146 lines × 2) · ×1
  • Duplicated block (144–146 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:111 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:111-254 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:116-261 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 267 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 (108 lines × 3) · ×1
  • Duplicated block (108 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:250 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:250-357 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:250-357 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:244-351 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:250` 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 (87 lines × 2) · ×1
  • Duplicated block (87 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:29 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:29-115 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:29-115 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt` as WHOLE FILES: 89% 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. 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 (82 lines × 3) · ×1
  • Duplicated block (82 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:120 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:120-201 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:120-201 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:108-189 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:120` 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 (74–75 lines × 2) · ×1
  • Duplicated block (74–75 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:219 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:219-293 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:444-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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:219` 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 after the matched lines, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:295` calls `when` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:519` 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 (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:19 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:19-89 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:20-90 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 192 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 (55–56 lines × 3) · ×1
  • Duplicated block (55–56 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:27 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:27-81 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt:27-82 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.js.kt:30-85 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 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 (53 lines × 4) · ×1
  • Duplicated block (53 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:114 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:114-166 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:104-156 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:114-166 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:104-156 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 98 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 (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:40 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:40-90 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:40-90 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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 (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:85 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:85-133 | mpp-idea/mpp-idea-exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/ShellCommandSuggestAction.kt:77-125 — 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 `mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:85` 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:43 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:43-90 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt:43-90 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:43` 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 (47–48 lines × 2) · ×1
  • Duplicated block (47–48 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:53 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:53-100 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactMessageList.kt:43-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:53` 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 (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:12 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:12-57 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt:12-57 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt` as WHOLE FILES: 90% 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 `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt:12` 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 (45–46 lines × 2) · ×1
  • Duplicated block (45–46 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:822 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:822-866 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:954-999 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 226 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:822` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (45 lines × 3) · ×1
  • Duplicated block (45 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:202 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:202-246 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:202-246 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:196-240 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:202` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (44 lines × 3) · ×1
  • Duplicated block (44 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt:28 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt:28-71 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.js.kt:28-71 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.wasmJs.kt:28-71 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.js.kt` as WHOLE FILES: 96% 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt:28` 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 (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:195 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:195-236 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:195-236 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:195` 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 (33–41 lines × 2) · ×1
  • Duplicated block (33–41 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:202 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:202-234 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:88-128 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:202` 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 (40 lines × 3) · ×1
  • Duplicated block (40 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:130 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:130-169 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:48-87 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:48-87 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:130` 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 (31–35 lines × 3) · ×1
  • Duplicated block (31–35 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt:67 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt:67-101 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:276-310 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:600-630 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 237 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (35 lines × 3) · ×1
  • Duplicated block (35 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:116 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:116-150 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt:117-151 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.js.kt:122-156 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 123 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:116` 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 (33–35 lines × 2) · ×1
  • Duplicated block (33–35 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:42 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:42-74 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:45-79 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 267 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:42` 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 (34 lines × 4) · ×1
  • Duplicated block (34 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:32 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:32-65 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:32-65 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:32-65 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:32-65 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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 (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:19 — mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:19-52 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:19-52 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:19-52 — before extracting anything, compare `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 150 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (30–34 lines × 2) · ×1
  • Duplicated block (30–34 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:115 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:115-144 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt:268-301 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanel.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt: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.
D4 · Code Duplication · Duplicated block (32–34 lines × 2) · ×1
  • Duplicated block (32–34 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:421 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:421-452 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:622-655 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt:421` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (31 lines × 5) · ×1
  • Duplicated block (31 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:90 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:90-120 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:91-121 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:91-121 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:90-120 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:91-121 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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 (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:550 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:550-579 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:633-663 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:550` 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–30 lines × 3) · ×1
  • Duplicated block (24–30 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:67 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:67-96 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:231-260 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:566-589 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:261` calls `flush` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:98` 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 (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:47 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:47-76 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:75-104 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:72` calls `augmentEnvironmentPath`, `environment` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:44` 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 (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:506 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:506-533 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:591-620 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:506` 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 (26–28 lines × 4) · ×1
  • Duplicated block (26–28 lines × 4) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:50 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:50-75 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:50-75 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:59-86 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:59-86 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 128 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:165 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:165-192 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:233-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (27 lines × 3) · ×1
  • Duplicated block (27 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt:98 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt:98-124 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.ios.kt:86-112 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.jvm.kt:37-63 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.ios.kt` as WHOLE FILES: 95% 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 (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:25 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:25-51 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:27-51 — before extracting anything, compare `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt` and `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:25` 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.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:28 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:28-53 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:28-53 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:28-53 — before extracting anything, compare `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` and `mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 330 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:28` 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 (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:200 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:200-223 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteCodingAgentViewModel.kt:184-209 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:200` 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 (25 lines × 5) · ×1
  • Duplicated block (25 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:62 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:62-86 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:63-87 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:63-87 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:62-86 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:63-87 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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 (25 lines × 4) · ×1
  • Duplicated block (25 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:23 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:23-47 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt:23-47 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.js.kt:23-47 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.wasmJs.kt:23-47 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 98 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 (20–24 lines × 3) · ×1
  • Duplicated block (20–24 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:449 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:449-468 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageAttachmentPanel.kt:363-382 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.jvm.kt:68-91 — 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. 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 (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/InlineIssueChip.kt:250 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/InlineIssueChip.kt:250-272 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:69-91 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/DiffViewDialog.kt:64-87 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/InlineIssueChip.kt:250` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:157 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:157-180 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:259-282 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:148-171 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:157` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (23 lines × 5) · ×1
  • Duplicated block (23 lines × 5) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:123 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:123-145 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:94-116 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:85-107 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:223-245 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:145-167 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:113 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:113-135 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:113-135 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:113-135 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:113-135 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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 (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImagePreviewDialog.kt:24 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImagePreviewDialog.kt:24-46 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageRenderer.kt:187-206 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImagePreviewDialog.kt:24` 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:738 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:738-759 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:816-838 — both copies are in the same file, so extract the 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:738` 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 (22 lines × 4) · ×1
  • Duplicated block (22 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:88 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:88-109 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:88-109 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:88-109 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:88-109 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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 × 3) · ×1
  • Duplicated block (22 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:196 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:196-217 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/SpecKitCommand.kt:134-155 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/SpecKitTemplateCompiler.kt:74-95 — 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. 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 × 3) · ×1
  • Duplicated block (21 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:67 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:67-87 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:99-119 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:84-104 — 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 `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:67` 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 (17–20 lines × 4) · ×1
  • Duplicated block (17–20 lines × 4) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:166 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:166-182 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:198-214 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:263-282 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/PythonArtifactExecutor.kt:140-159 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 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 `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:166` 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 (18–20 lines × 3) · ×1
  • Duplicated block (18–20 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:95 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:95-114 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:120-139 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:59-76 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:478 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:478-497 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt:488-505 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditContent.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 151 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt:478` 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 (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:144 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:144-159 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:328-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 `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:144` 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 (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/QualityReviewPanel.kt:239 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/QualityReviewPanel.kt:239-257 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:573-592 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/QualityReviewPanel.kt:239` 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 (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:190 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:190-208 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt:364-382 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt:224-242 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/DocumentAgentExecutor.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–19 lines × 3) · ×1
  • Duplicated block (14–19 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:209 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:209-224 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:430-443 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:98-116 — 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:98 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:98-115 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/RemoteServerConfigDialog.kt:63-80 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:86-104 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:300 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:300-318 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/ShellEnvironmentUtils.kt:56-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:64 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:64-82 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:102-116 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:64` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:56 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:56-71 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:222-240 — both copies are in the same file, so extract the 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/changes/FileChangeSummary.kt:56` 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 (17–18 lines × 5) · ×1
  • Duplicated block (17–18 lines × 5) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:302 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:302-318 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:212-229 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:212-229 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:212-229 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:212-229 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt` and `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (17–18 lines × 3) · ×1
  • Duplicated block (17–18 lines × 3) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:111 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:111-128 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:536-553 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:78-94 — before extracting anything, compare `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt` and `mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:109` calls `initialize` and `mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:535` 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–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:61 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:61-78 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:60-76 — before extracting anything, compare `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt` and `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 103 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:61` 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.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:503 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:503-518 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentContent.kt:299-316 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:503` 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 (17 lines × 8) · ×1
  • Duplicated block (17 lines × 8) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:139 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:139-155 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:167-183 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:139-155 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:167-183 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:139-155 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:167-183 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:139-155 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:167-183 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `ChartDataContent.ColumnData` in one and `ChartDataContent.RowData` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (16–17 lines × 5) · ×1
  • Duplicated block (16–17 lines × 5) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:33 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:33-49 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:151-166 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:152-167 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:200-215 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:535-550 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:33` 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, `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:28` calls `hasIncompleteDevinBlock`, `toString` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:197` 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 (16–17 lines × 4) · ×1
  • Duplicated block (16–17 lines × 4) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:113 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:113-129 | mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:143-158 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:113-129 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:143-158 — before extracting anything, compare `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 189 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:113` 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 (14–17 lines × 3) · ×1
  • Duplicated block (14–17 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:77 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:77-93 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:23-36 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt:23-36 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt` 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 10) · ×1
  • Duplicated block (16 lines × 10) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:70 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:70-85 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:99-114 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:71-86 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:100-115 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:71-86 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:100-115 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:70-85 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:99-114 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:71-86 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:100-115 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:70` 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 (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:76 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:76-91 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:69-84 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:69-84 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:69-84 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:69-84 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt` and `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 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 (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:143 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:143-156 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt:61-74 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:106-121 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.wasmJs.kt:61-74 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt` and `mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:232 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:232-247 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:232-247 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:232-247 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:232-247 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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 (11–16 lines × 3) · ×1
  • Duplicated block (11–16 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:142 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:142-152 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:138-148 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:325-340 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt` and `mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 157 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–16 lines × 3) · ×1
  • Duplicated block (13–16 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:191 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:191-203 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/CloudStorageConfigDialog.kt:213-228 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/RemoteServerConfigDialog.kt:250-265 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:119 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt:119-134 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt:31-44 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/diff/DiffUtils.kt` and `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/diff/model/StreamDiff.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 (7–16 lines × 2) · ×1
  • Duplicated block (7–16 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlanPanel.kt:107 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlanPanel.kt:107-113 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TaskPanel.kt:67-82 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlanPanel.kt:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:320 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:320-334 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:233-246 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:233-246 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:233-246 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:233-246 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt` and `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:44 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:44-58 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:45-59 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:45-59 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:44-58 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:45-59 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:44` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–15 lines × 2) · ×1
  • Duplicated block (8–15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:66 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:66-73 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:94-108 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:27 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:27-40 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-39 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-39 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:27-40 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-39 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 109 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanLangSketch.kt:274 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanLangSketch.kt:274-286 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanToolbarFactory.kt:57-70 — 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanLangSketch.kt:274` 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 (9–14 lines × 2) · ×1
  • Duplicated block (9–14 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:120 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:120-128 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:187-200 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:120` 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 (12–13 lines × 8) · ×1
  • Duplicated block (12–13 lines × 8) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:34 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:34-45 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:39-51 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:34-45 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:29-41 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:34-45 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:42-54 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:34-45 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:29-41 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 225 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–13 lines × 3) · ×1
  • Duplicated block (9–13 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:32 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:32-44 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:55-67 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:378-386 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 90 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `ShellExecutionConfig ): ShellResult = withContext(Dispatchers.IO` in one and `ShellExecutionConfig ): LiveShellSession = withContext(Dispatchers.IO` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:72` calls `augmentEnvironmentPath`, `environment` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:47` 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 (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:117 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:117-129 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:142-154 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:79-90 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 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 (10–13 lines × 3) · ×1
  • Duplicated block (10–13 lines × 3) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateEntityAction.kt:36 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateEntityAction.kt:36-45 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateFunctionAction.kt:36-48 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateUnittestAction.kt:36-47 — 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 `mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateEntityAction.kt:36` 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 (7–13 lines × 2) · ×1
  • Duplicated block (7–13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:52 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:52-58 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:71-83 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:52` 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 (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:32 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt:32-43 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt:34-45 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.js.kt:32-43 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.jvm.kt:32-43 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.wasmJs.kt:32-43 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.android.kt` and `mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/DocumentIndexRepository.ios.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 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 × 4) · ×1
  • Duplicated block (12 lines × 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/MarkdownDocumentParser.kt:45 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/MarkdownDocumentParser.kt:45-56 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/JsoupDocumentParser.kt:76-87 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/PdfDocumentParser.kt:97-108 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/TikaDocumentParser.kt:88-99 — 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 (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:760 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:760-771 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:822-832 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:843-854 — 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 `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:760` 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 after the matched lines, `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:857` calls `clear` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:773` 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 (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:199 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:199-208 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:284-295 — 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:199` 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 (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:83 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:83-93 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:199-210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/DateComponents.kt:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:124 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:124-134 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:95-105 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:86-96 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:224-234 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DomainDictCli.kt:199-209 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:132-142 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:146-156 — before extracting anything, compare `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt` and `mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:283 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:283-292 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:321-331 — both copies are in the same file, so extract the 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 `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:283` 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 (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:41 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:41-50 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShireFileEditorWithPreview.kt:66-73 — 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 `mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:41` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:40 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:40-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt:37-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SwiftLintLinter.kt:37-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt:40-47 — before extracting anything, compare `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:103 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:103-109 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:117-123 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:131-137 | mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:159-165 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:62-68 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:92-98 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. 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 first that the copies are not typed on the same thing: the declarations holding them bind `null` to `"error" to "Missing sessionId") ) val session = sessionManager.getSession(sessionId) if (session !=` in one and `"error" to "Missing workflowId") ) val metadata = workflowEngine.queryMetadata(workflowId) if (metadata ==` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:150 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:150-155 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:224-230 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:242-248 — before extracting anything, compare `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 122 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:150` 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 (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:108 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:108-113 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:69-74 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:207-212 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/E2ECli.kt:123-128 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:129-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (85 lines × 2) · ×1
  • Duplicated block (85 lines × 2) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/BrowserStorage.kt:26 — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/BrowserStorage.kt:26-110 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/BrowserStorage.kt:13-97 — before extracting anything, compare `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/BrowserStorage.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/BrowserStorage.kt` as WHOLE FILES: 97% 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/BrowserStorage.kt:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.js.kt:13 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.js.kt:13-52 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.wasmJs.kt:13-52 — before extracting anything, compare `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.js.kt` and `mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.wasmJs.kt` as WHOLE FILES: 94% 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.js.kt:13` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:165 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:165-173 | mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:226-234 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:264-272 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:125-133 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:235 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:235-247 | mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:265-277 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:250-262 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:113-125 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:191-203 — before extracting anything, compare `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt` and `mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:233` calls `getToolConfigPath`, `getToolConfigFile` and `mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:104` 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 × 4) · ×1
  • Duplicated block (13 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.android.kt:25 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.android.kt:25-37 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.js.kt:25-37 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalWidget.kt:360-373 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.wasmJs.kt:25-37 — before extracting anything, compare `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.android.kt` and `mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.js.kt` as WHOLE FILES: 96% 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalDisplay.android.kt:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `modifier` to `Modifier` in one and `Modifier = Modifier` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:348 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:348-357 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:377-386 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:406-415 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:455-464 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:481-490 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:507-516 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:348` 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.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — mpp-ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (14 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (14 clone groups) mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20 — 14 duplicated blocks under the repository root have copies in at least two of the sibling directories mpp-codegraph, mpp-core, mpp-ui, mpp-vscode, mpp-web — 11 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (135 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (135 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:243 — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:243 · mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:294 — the two spans are one implementation copied and then locally edited — 902 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 (75 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (75 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:114 — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:114 · mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:56 — the two spans are one implementation copied and then locally edited — 376 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (66 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (66 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20 — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:20 · mpp-vscode/src/services/config-manager.ts:19 — the two spans are one implementation copied and then locally edited — 401 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 (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) mpp-core/webpack.config.d/node-polyfills.js:5 — mpp-core/webpack.config.d/node-polyfills.js:5 · mpp-ui/webpack.config.d/node-polyfills.js:5 — 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 (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:218 — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:218 · mpp-vscode/src/services/config-manager.ts:51 — 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 (39 lines × 4 locations) · ×1
  • Duplicated block (39 lines × 4 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1455 — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1455 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1606 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1670 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1740 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169 — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169 · mpp-web/src/services/LLMService.ts:118 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.tsx:23 — mpp-vscode/webview/src/components/sketch/CodeBlockRenderer.tsx:23 · mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:25 — the two spans are one implementation copied and then locally edited — 135 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 (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1888 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (22 lines × 3 locations) · ×1
  • Duplicated block (22 lines × 3 locations) mpp-vscode/src/actions/auto-actions.ts:46 — mpp-vscode/src/actions/auto-actions.ts:46 · mpp-vscode/src/actions/auto-actions.ts:105 · mpp-vscode/src/actions/auto-actions.ts:171 — 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.
R10 · Code Duplication · Duplicated block with local edits (21 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (21 matched lines × 2 locations) mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:280 — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:280 · mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:69 — the two spans are one implementation copied and then locally edited — 139 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) mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:155 — mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:155 · mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:197 — the two spans are one implementation copied and then locally edited — 139 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) mpp-ui/src/jsMain/typescript/agents/LLMService.ts:60 — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:60 · mpp-ui/src/jsMain/typescript/agents/LLMService.ts:119 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (16 lines × 3 locations) · ×1
  • Duplicated block (16 lines × 3 locations) mpp-vscode/src/providers/devins-completion.ts:90 — mpp-vscode/src/providers/devins-completion.ts:90 · mpp-vscode/src/providers/devins-completion.ts:107 · mpp-vscode/src/providers/devins-completion.ts:124 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (14 lines × 4 locations) · ×1
  • Duplicated block (14 lines × 4 locations) mpp-vscode/src/providers/code-element-parser.ts:508 — mpp-vscode/src/providers/code-element-parser.ts:508 · mpp-vscode/src/providers/code-element-parser.ts:543 · mpp-vscode/src/providers/code-element-parser.ts:578 · mpp-vscode/src/providers/code-element-parser.ts:598 — 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.
R10 · Code Duplication · Duplicated block with local edits (14 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (14 matched lines × 2 locations) mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:95 — mpp-vscode/webview/src/components/sketch/TerminalRenderer.tsx:95 · mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:94 — the two spans are one implementation copied and then locally edited — 87 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 (13 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (13 matched lines × 2 locations) mpp-ui/scripts/analyze-test-results.cjs:104 — mpp-ui/scripts/analyze-test-results.cjs:104 · mpp-ui/scripts/validate-scenarios.js:287 — the two spans are one implementation copied and then locally edited — 51 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 (12 lines × 2 locations) · ×1
  • Duplicated block (12 lines × 2 locations) mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:59 — mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:59 · mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:96 — 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 (12 lines × 8 locations) · ×1
  • Duplicated block (12 lines × 8 locations) mpp-vscode/src/providers/code-element-parser.ts:487 — mpp-vscode/src/providers/code-element-parser.ts:487 · mpp-vscode/src/providers/code-element-parser.ts:503 · mpp-vscode/src/providers/code-element-parser.ts:523 · mpp-vscode/src/providers/code-element-parser.ts:538 · +4 more site(s) not listed — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (11 lines × 4 locations) · ×1
  • Duplicated block (11 lines × 4 locations) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:76 — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:76 · mpp-ui/src/jsMain/typescript/index.tsx:383 · mpp-ui/src/jsMain/typescript/index.tsx:556 · mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:71 — the 3 copies are spread across 3 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) mpp-ui/src/jsMain/typescript/index.tsx:121 — mpp-ui/src/jsMain/typescript/index.tsx:121 · mpp-ui/src/jsMain/typescript/index.tsx:379 · mpp-ui/src/jsMain/typescript/index.tsx:553 — 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:35 — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:35 · mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:47 — 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.
R2 · Cyclomatic Complexity · Complex function classifyToolKind (cyclomatic 55, cognitive 16) · ×1
  • Complex function classifyToolKind (cyclomatic 55, cognitive 16) mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:194 — classifyToolKind has cyclomatic complexity 55 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 formatToolCallDisplay (cyclomatic 40, cognitive 38) · ×1
  • Complex function formatToolCallDisplay (cyclomatic 40, cognitive 38) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:232 — formatToolCallDisplay has cyclomatic complexity 40 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function validateScenario (cyclomatic 36, cognitive 54) · ×1
  • Complex function validateScenario (cyclomatic 36, cognitive 54) mpp-ui/scripts/validate-scenarios.js:57 — validateScenario has cyclomatic complexity 36 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 36, cognitive 28) · ×1
  • Complex function (anonymous) (cyclomatic 36, cognitive 28) mpp-vscode/webview/src/App.tsx:86 — (anonymous) has cyclomatic complexity 36 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs 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 readTopLevelBindingDeclarations (cyclomatic 35, cognitive 70) · ×1
  • Complex function readTopLevelBindingDeclarations (cyclomatic 35, cognitive 70) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1431 — readTopLevelBindingDeclarations has cyclomatic complexity 35 and cognitive complexity 70; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 evaluateCondition (cyclomatic 34, cognitive 43) · ×1
  • Complex function evaluateCondition (cyclomatic 34, cognitive 43) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:158 — evaluateCondition has cyclomatic complexity 34 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 findVariableDeclarationEnd (cyclomatic 33, cognitive 52) · ×1
  • Complex function findVariableDeclarationEnd (cyclomatic 33, cognitive 52) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1723 — findVariableDeclarationEnd has cyclomatic complexity 33 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 sessionUpdate (cyclomatic 31, cognitive 31) · ×1
  • Complex function sessionUpdate (cyclomatic 31, cognitive 31) mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:334 — sessionUpdate has cyclomatic complexity 31 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ModelConfigDialog (cyclomatic 28, cognitive 27) · ×1
  • Complex function ModelConfigDialog (cyclomatic 28, cognitive 27) mpp-vscode/webview/src/components/ModelConfigDialog.tsx:40 — ModelConfigDialog has cyclomatic complexity 28 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 formatToolCallDisplay (cyclomatic 25, cognitive 21) · ×1
  • Complex function formatToolCallDisplay (cyclomatic 25, cognitive 21) mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:282 — formatToolCallDisplay has cyclomatic complexity 25 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 runDocument (cyclomatic 23, cognitive 47) · ×1
  • Complex function runDocument (cyclomatic 23, cognitive 47) mpp-ui/src/jsMain/typescript/modes/DocumentMode.ts:106 — runDocument has cyclomatic complexity 23 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function WebUiApp (cyclomatic 23, cognitive 17) · ×1
  • Complex function WebUiApp (cyclomatic 23, cognitive 17) mpp-web/src/App.tsx:7 — WebUiApp has cyclomatic complexity 23 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function findMatchingBraceEnd (cyclomatic 22, cognitive 40) · ×1
  • Complex function findMatchingBraceEnd (cyclomatic 22, cognitive 40) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1657 — findMatchingBraceEnd has cyclomatic complexity 22 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 findBlockDeclarationEnd (cyclomatic 21, cognitive 36) · ×1
  • Complex function findBlockDeclarationEnd (cyclomatic 21, cognitive 36) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1593 — findBlockDeclarationEnd has cyclomatic complexity 21 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 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 runCodingAgent (cyclomatic 21, cognitive 24) · ×1
  • Complex function runCodingAgent (cyclomatic 21, cognitive 24) mpp-ui/src/jsMain/typescript/index.tsx:62 — runCodingAgent has cyclomatic complexity 21 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 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 parseTestResult (cyclomatic 20, cognitive 24) · ×1
  • Complex function parseTestResult (cyclomatic 20, cognitive 24) mpp-ui/scripts/analyze-test-results.cjs:154 — parseTestResult has cyclomatic complexity 20 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 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 RenderProgress (cyclomatic 20, cognitive 16) · ×1
  • Complex function RenderProgress (cyclomatic 20, cognitive 16) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:809 — RenderProgress has cyclomatic complexity 20 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 handleLine (cyclomatic 20, cognitive 14) · ×1
  • Complex function handleLine (cyclomatic 20, cognitive 14) mpp-ui/src/jsMain/typescript/node-repl/server.ts:97 — handleLine has cyclomatic complexity 20 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildFromConfig (cyclomatic 19, cognitive 27) · ×1
  • Complex function buildFromConfig (cyclomatic 19, cognitive 27) mpp-ui/src/test/framework/loaders/JsonScenarioLoader.ts:128 — buildFromConfig has cyclomatic complexity 19 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts · ×1
  • mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts: 1803 lines of code mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1 — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts has 1803 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 · mpp-vscode/src/providers/chat-view.ts · ×1
  • mpp-vscode/src/providers/chat-view.ts: 1085 lines of code mpp-vscode/src/providers/chat-view.ts:1 — mpp-vscode/src/providers/chat-view.ts has 1085 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 · mpp-vscode/webview/src/components/nano/NanoRenderer.tsx · ×1
  • mpp-vscode/webview/src/components/nano/NanoRenderer.tsx: 901 lines of code mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:1 — mpp-vscode/webview/src/components/nano/NanoRenderer.tsx has 901 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · mpp-vscode/src/bridge/mpp-core.ts · ×1
  • mpp-vscode/src/bridge/mpp-core.ts: 639 lines of code mpp-vscode/src/bridge/mpp-core.ts:1 — mpp-vscode/src/bridge/mpp-core.ts has 639 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 · mpp-vscode/src/providers/code-element-parser.ts · ×1
  • mpp-vscode/src/providers/code-element-parser.ts: 605 lines of code mpp-vscode/src/providers/code-element-parser.ts:1 — mpp-vscode/src/providers/code-element-parser.ts has 605 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 · mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts · ×1
  • mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts: 604 lines of code mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:1 — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts has 604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · mpp-ui/src/jsMain/typescript/index.tsx · ×1
  • mpp-ui/src/jsMain/typescript/index.tsx: 509 lines of code mpp-ui/src/jsMain/typescript/index.tsx:1 — mpp-ui/src/jsMain/typescript/index.tsx has 509 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 · mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts · ×1
  • mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts: 506 lines of code mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:1 — mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts has 506 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 · mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts · ×1
  • mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts: 495 lines of code mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:1 — mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts has 495 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 · mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts · ×1
  • mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts: 488 lines of code mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:1 — mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts has 488 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 · mpp-vscode/webview/src/App.tsx · ×1
  • mpp-vscode/webview/src/App.tsx: 470 lines of code mpp-vscode/webview/src/App.tsx:1 — mpp-vscode/webview/src/App.tsx has 470 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 · mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts · ×1
  • mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts: 459 lines of code mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:1 — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts has 459 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 · mpp-web/src/App.tsx · ×1
  • mpp-web/src/App.tsx: 430 lines of code mpp-web/src/App.tsx:1 — mpp-web/src/App.tsx has 430 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 · mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts · ×1
  • mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts: 412 lines of code mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:1 — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts has 412 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 · No test rig can mount a component in this workspace · ×1
  • No test rig can mount a component in this workspace mpp-ui/vitest.config.ts:1 — mpp-ui/vitest.config.ts declares environment "node", and no package here declares a DOM implementation (jsdom / happy-dom), a component testing library or a browser runner — so none of the 36 unreached component module(s) can be tested as written, however the suite is authored: mpp-vscode/webview/src/components/nano/NanoRenderer.tsx, mpp-ui/src/jsMain/typescript/index.tsx, mpp-vscode/webview/src/App.tsx, mpp-web/src/App.tsx, mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx, mpp-ui/src/jsMain/typescript/ui/ModelConfigForm.tsx and 30 more. Add a DOM environment and a component testing library (for example jsdom + @testing-library, or the runner's browser mode), then test the components. Reported once because these files share one cause, not one omission each.
R7 · Dead Code · Dead file (~457 LoC) · ×1
  • Dead file (~457 LoC) mpp-web/src/App.tsx — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~368 LoC) · ×1
  • Dead file (~368 LoC) mpp-vscode/webview/src/components/nano/NanoActionHandler.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 2 in-repo import(s) from 1 other file(s) do name it (mpp-vscode/webview/src/components/nano/index.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 (~203 LoC) · ×1
  • Dead file (~203 LoC) mpp-ui/src/jsMain/typescript/design-system/index.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~195 LoC) · ×1
  • Dead file (~195 LoC) mpp-web/src/services/LLMService.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (mpp-web/src/App.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 (~173 LoC) · ×1
  • Dead file (~173 LoC) mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~81 LoC) · ×1
  • Dead file (~81 LoC) mpp-vscode/webview/src/components/MessageList.tsx — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~77 LoC) · ×1
  • Dead file (~77 LoC) mpp-ui/webpack.config.d/node-polyfills.js — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~50 LoC) · ×1
  • Dead file (~50 LoC) mpp-ui/src/jsMain/typescript/ui/LanguageSwitcher.tsx — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~47 LoC) · ×1
  • Dead file (~47 LoC) mpp-web/src/services/ConfigService.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (mpp-web/src/App.tsx, mpp-web/src/services/LLMService.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 (~33 LoC) · ×1
  • Dead file (~33 LoC) mpp-vscode/webview/src/components/nano/index.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~10 LoC) · ×1
  • Dead file (~10 LoC) mpp-ui/src/jsMain/typescript/agents/acp/index.ts — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~0 LoC) · ×1
  • Dead file (~0 LoC) mpp-ui/webpack.config.d/zzzz-wasm-experiments.js — no import path from any entry point (20 application, 22 tooling, 43 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency '@js-joda/core' · ×1
  • Unused dependency '@js-joda/core' — Declared in mpp-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency '@modelcontextprotocol/sdk' · ×1
  • Unused dependency '@modelcontextprotocol/sdk' — Declared in mpp-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'dotenv' · ×1
  • Unused dependency 'dotenv' — Declared in mpp-ui/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity mpp-viewer-web/src/commonMain/resources/mermaid.html:99 — `https://cdn.jsdelivr.net/npm/mermaid@11.4.0/dist/mermaid.min.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 2 such include(s) across the repository's markup.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked — No package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock — JS installs aren't reproducible (SSDF PW.4.4). Commit your package manager's lockfile and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X12 · Unreachable branch · Switch arm can never match its case-normalised subject · ×1
  • Switch arm can never match its case-normalised subject mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/select/SelectElementStrategy.kt:110 — The when subject is `strategy.lowercase()`, so every value reaching these branches has already been lower-cased by `lowercase()` (line 107). The condition `"selectAll"` carries a letter of the opposite case, and a `when` condition compares with `==`, so it cannot equal that subject for ANY input — this branch is dead and whatever it was meant to handle silently falls to a later branch or the `else`. Match the normalised spelling (`"selectall"`), or drop the normaliser and compare with `equals(…, ignoreCase = true)`.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:37 — `NanoExpressionEvaluator.jsonElementToRuntimeValue` is public and takes `el: JsonElement ?` from its caller, and it calls itself at line 37 with a piece of `el` (and at line 38) — the function is not `tailrec`, so every call is a real frame — and nowhere in `NanoExpressionEvaluator.jsonElementToRuntimeValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. On the JVM's default 1 MB thread stack a recursive walk throws `StackOverflowError` from about 500–2,000 levels on a cold first call and 6,000–17,000 once warmed up (OpenJDK 21 and 25; Android's threads are smaller). kotlinx.serialization's `parseToJsonElement` accepts nested arrays to any depth and Android's built-in `org.json` sets no limit, while Jackson 2.15+ stops at 1,000 — on a cold JVM past the point the walk fails; Gson 2.12+ and Moshi stop at 255. `StackOverflowError` is an `Error`, not an `Exception`: a `catch (e: Exception)` around the call does not stop it, and on Android an uncaught one ends the process. Thread a depth argument through `NanoExpressionEvaluator.jsonElementToRuntimeValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack or a `DeepRecursiveFunction`.
X18 · Disposal-pattern correctness · Owned disposable field is never released · ×1
  • Owned disposable field is never released mpp-vscode/src/services/diff-manager.ts:62 — `DiffManager` declares a disposal member — so it has told every caller it holds something worth releasing — and it constructs `onDidChangeEmitter` itself (line 62, `new vscode.EventEmitter`), which makes that instance its own. But `onDidChangeEmitter` is named in none of the methods the disposal search covered: `dispose` (line 80) — that is the disposal member plus every method it calls on `this` BY NAME, so a release reached through a base class, a callback or a registry is not followed and is worth checking before acting. The field is released nowhere else in the class and is never handed to anything else, so no other owner can be releasing it. On what was read, the class's disposal releases everything except the one thing it owns. Whatever `vscode.EventEmitter` holds until its own `dispose()` runs — the listeners subscribed to it, a pending timer, GPU memory — outlives this instance's disposal: a subscriber that registered through it stays attached, and anything that holds the subscription keeps the whole chain reachable. Release it in the disposal member (`this.onDidChangeEmitter.dispose()`), or, if it truly does not need releasing, drop the disposal member so the claim and the behaviour agree.
Minor — 807 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×599
  • Orphaned file mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt: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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/WebElementSourceMapperTool.kt: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 mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/runconfig/RunConfigService.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt: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 mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaDiffComponents.kt: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 mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/runconfig/RunButton.kt: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 mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt: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 mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditVisionHelper.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/BrowserActionExecutor.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt: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 mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/ShireRunner.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourcePanel.kt: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 mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/SimplifiedLLMSettingComponent.kt: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 mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/AccessibilityTree.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LintDetector.kt: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 mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactWelcome.kt: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 mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt: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 mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/ShireExpression.kt: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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt: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 mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt: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.
  • + 574 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:39 — `error` at line 39 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:50 — `error` at line 50 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:173 — `error` at line 173 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:184 — `error` at line 184 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/AutoTestInMenuAction.kt:92 — `warn` at line 92 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/base/ChatBaseAction.kt:47 — `info` at line 47 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/console/FixThisAction.kt:35 — `error` at line 35 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/custom/CustomAgentExecutor.kt:77 — `info` at line 77 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/custom/CustomAgentChatProcessor.kt:43 — `error` at line 43 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/SpecKitTemplateCompiler.kt:80 — `warn` at line 80 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/SpecKitTemplateCompiler.kt:86 — `warn` at line 86 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt:77 — `error` at line 77 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/CustomActionBaseIntention.kt:120 — `error` at line 120 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/action/CustomPromptConfig.kt:45 — `warn` at line 45 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/compile/VariableTemplateCompiler.kt:75 — `error` at line 75 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.error("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/document/CustomLivingDocTask.kt:26 — `info` at line 26 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/document/CustomLivingDocTask.kt:39 — `info` at line 39 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/team/CustomActionPrompt.kt:171 — `warn` at line 171 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt:66 — `info` at line 66 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.info("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt:76 — `warn` at line 76 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:46 — `debug` at line 46 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:80 — `debug` at line 80 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/scoring/FileWeightCalculator.kt:92 — `debug` at line 92 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMInlayManagerImpl.kt:59 — `warn` at line 59 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.warn("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • Interpolated log message defeats structured logging mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/codecomplete/LLMInlayManagerImpl.kt:152 — `debug` at line 152 is handed a message assembled at the call — a string template with `$…` values in it, a concatenation or `String.format` — through SLF4J, log4j 2 or kotlin-logging, so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the level is filtered out. Pass a constant pattern and the values beside it instead: `log.debug("Order {} moved to {}", orderId, status)`, which keeps the pattern and its arguments apart on the event for a structured encoder (logstash-logback-encoder, log4j 2's JsonTemplateLayout, OpenTelemetry), or with kotlin-logging `logger.atInfo { message = "Order moved"; payload = mapOf("order_id" to orderId, "status" to status) }`. An exception goes last, as the throwable argument, not into the text.
  • + 15 more in this group — see findings.md.
P2 · Observability · Console output used as the logging channel · ×39
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:173 — `mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts` reports through `console.*` at line 173 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts:177 — `mpp-ui/src/jsMain/typescript/agents/ServerAgentClient.ts` reports through `console.*` at line 177 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/LLMService.ts:49 — `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/LLMService.ts:100 — `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 100 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/LLMService.ts:161 — `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/LLMService.ts:206 — `mpp-ui/src/jsMain/typescript/agents/LLMService.ts` reports through `console.*` at line 206 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:95 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 95 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:107 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 107 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:117 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 117 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:157 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 157 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:169 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 169 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:197 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 197 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:213 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 213 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:252 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 252 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:424 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 424 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:445 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts` reports through `console.*` at line 445 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:45 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:64 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 64 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:65 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 65 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:98 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:100 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 100 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:142 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 142 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:153 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 153 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:175 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 175 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:355 — `mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts` reports through `console.*` at line 355 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • + 14 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×34
  • Silent fallback default in catch mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/WorkspaceFileSearchProvider.kt:171 — `getDefaultRecentFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt:327 — `parseRows` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/A2ASketchToolchainProvider.kt:20 — `collectA2ATools` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:170 — `getAgentName` swallows every exception into `"Unknown Agent"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:104 — `loadFromProjectRoot` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:131 — `loadFromUserSkillsDir` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/SpecKitCommand.kt:75 — `all` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/SimilarChunkVariableResolver.kt:16 — `resolve` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/envior/ShireEnvReader.kt:77 — `getAllEnvironments` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/model/ParsedToolCall.kt:47 — `fromString` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/FilePriorityCalculator.kt:176 — `getFileSize` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow/ReactAutoPage.kt:115 — `getDesignSystemComponents` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/omnibar/IdeaOmnibarDataProvider.kt:106 — `getCustomCommands` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaDiffActions.kt:37 — `parsePatches` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:69 — `listFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:278 — `getFileNameFromUri` swallows every exception into `"unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.android.kt:70 — `listDirectories` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:98 — `listFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:139 — `searchFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.kt:111 — `getDistinctValues` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/DevInsNodeProcessor.kt:141 — `getNodeText` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/FileSearch.kt:107 — `crawlFiles` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/SpecKitCommandCompletionProvider.kt:61 — `loadSpecKitCommands` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.ios.kt:72 — `listDirectories` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.js.kt:103 — `listDirectories` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. 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 in the catch or in the KDoc, and the row stops firing.
  • + 9 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:290 — `!!active.baseUrl && !!active.apiKey && !!active.model` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts, mpp-vscode/src/services/config-manager.ts. 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 mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:293 — `!!active.provider && !!active.apiKey && !!active.model` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts, mpp-vscode/src/services/config-manager.ts. 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 mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:237 — `!this.configFile.active || this.configFile.configs.length === 0` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/config/ConfigManager.ts, mpp-vscode/src/services/config-manager.ts. 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 mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:165 — `compileResult?.errorMessage || 'Failed to read file'` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts, mpp-ui/src/jsMain/typescript/modes/ChatMode.ts. 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 mpp-core/webpack.config.d/node-polyfills.js:35 — `compiler && compiler.hooks && compiler.hooks.normalModuleFactory` appears character-identically in 2 files — mpp-core/webpack.config.d/node-polyfills.js, mpp-ui/webpack.config.d/node-polyfills.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:381 — `diffInfo && (diffInfo.additions > 0 || diffInfo.deletions > 0)` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:173 — `errorMessage.includes('401') || errorMessage.includes('Unauthorized')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:177 — `errorMessage.includes('403') || errorMessage.includes('Forbidden')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:181 — `errorMessage.includes('429') || errorMessage.includes('rate limit')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:189 — `errorMessage.includes('ECONNREFUSED') || errorMessage.includes('connection refused')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:193 — `errorMessage.includes('ENOTFOUND') || errorMessage.includes('getaddrinfo')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/LLMService.ts:185 — `errorMessage.includes('timeout') || errorMessage.includes('ETIMEDOUT')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/LLMService.ts, mpp-web/src/services/LLMService.ts. 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 mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:565 — `line.startsWith('+') && !line.startsWith('+++')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts. 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 mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:567 — `line.startsWith('-') && !line.startsWith('---')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts. 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 mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts:41 — `mppCore['module.exports'] || mppCore.default || mppCore` appears character-identically in 3 files — mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts, mpp-ui/src/jsMain/typescript/utils/commandUtils.ts, mpp-ui/src/jsMain/typescript/utils/renderUtils.ts. 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 mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:444 — `output.includes('updated') || output.includes('overwrote') || output.includes('Successfully')` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts. 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 mpp-ui/scripts/prepare-node-modules.js:114 — `process.env.AUTODEV_CODEX_CUA_NODE_DIR || defaultCodexCuaNodeDir` appears character-identically in 2 files — mpp-ui/scripts/prepare-node-modules.js, mpp-ui/scripts/prepare-node-runtime.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mpp-core/webpack.config.d/node-polyfills.js:40 — `request && /wasm-git/.test(request.context || '') && request.request === './'` appears character-identically in 2 files — mpp-core/webpack.config.d/node-polyfills.js, mpp-ui/webpack.config.d/node-polyfills.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:184 — `result.type === 'handled' && result.output` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts, mpp-ui/src/jsMain/typescript/ui/App.tsx. 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 mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts:364 — `status === 'completed' || status === 'failed'` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/acp/AcpClientConnection.ts, mpp-ui/src/jsMain/typescript/modes/CodexMode.ts. 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 mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:378 — `toolName === 'write-file' || toolName === 'edit-file'` appears character-identically in 2 files — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts, mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts. 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 mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:108 — `!continueConversation || !hasActiveConversation` appears character-identically in 2 files — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodingAgentExecutor.kt. 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 mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt:82 — `!dirPath.exists() || !dirPath.isDirectory()` appears character-identically in 2 files — mpp-core/src/androidMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.kt, mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt. 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 mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:210 — `!event.isError && (event.message.contains("✓") || event.message.contains("ready"))` appears character-identically in 2 files — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt, mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteCodingAgentViewModel.kt. 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 mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaThinkingBlockRenderer.kt:39 — `!isAtBottom && scrollState.isScrollInProgress` appears character-identically in 2 files — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaThinkingBlockRenderer.kt, mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/ThinkingBlockRenderer.kt. 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.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×24
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/ArtifactAgent.kt:213 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/ArtifactAgent.kt:288 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ShellCheckLinter.kt:43 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ShellCheckLinter.kt:44 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ShellCheckLinter.kt:45 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ShellCheckLinter.kt:46 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ShellCheckLinter.kt:47 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/BiomeLinter.kt:43 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/BiomeLinter.kt:44 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/DevinBlockParser.kt:14 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt:71 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PythonArtifactAgent.kt:145 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:15 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:16 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:17 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:18 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt:115 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:15 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:16 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:603 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:280 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/AcpReplayCli.kt:167 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/AcpReplayCli.kt:168 — 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 JVM code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/AcpReplayCli.kt:174 — 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 JVM code already uses a real parser in the same package; use it here too.
M4 · Documentation accuracy · README/code drift · ×8
  • README/code drift mpp-core/README.md:174 — mpp-core/README.md names `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt`, but no file or folder `src/jsTest/kotlin/cc/unitmesh/yaml/JsYamlTest.kt` 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 mpp-core/README.md:228 — mpp-core/README.md names the package `@autodev/cli`, but no package.json of the workspace declares or depends on it. 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 mpp-ios/README.md:148 — mpp-ios/README.md links to `PODFILE-CONFIG.md`, but `mpp-ios/PODFILE-CONFIG.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift mpp-ios/README.md:202 — mpp-ios/README.md names `build-and-run.sh`, but no file or folder `build-and-run.sh` 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 mpp-ui/docs/I18N.md:336 — mpp-ui/docs/I18N.md links to `../CONTRIBUTING.md#translations`, but `mpp-ui/CONTRIBUTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift mpp-ui/src/jvmMain/resources/README.md:36 — mpp-ui/src/jvmMain/resources/README.md runs `bash scripts/convert-icon.sh`, but `scripts/convert-icon.sh` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift mpp-ui/src/test/framework/README.md:142 — mpp-ui/src/test/framework/README.md runs `npx ts-node src/test/framework/cli.ts suite basic`, but `src/test/framework/cli.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/automation/README.md:268 — mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/automation/README.md links to `../AUTOMATION_TEST_SUMMARY.md`, but `mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/AUTOMATION_TEST_SUMMARY.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
R7 · Dead Code · Unused export 'default' · ×3
  • Unused export 'default' mpp-ui/src/jsMain/typescript/design-system/colors.ts:409 — Nothing ultimately consumes this binding: its only referrer is the re-export in mpp-ui/src/jsMain/typescript/design-system/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in mpp-ui/src/jsMain/typescript/design-system/index.ts in the same commit, or the barrel will import a name that no longer exists.
  • Unused export 'default' mpp-ui/src/jsMain/typescript/design-system/theme-helpers.ts:165 — Nothing ultimately consumes this binding: its only referrer is the re-export in mpp-ui/src/jsMain/typescript/design-system/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in mpp-ui/src/jsMain/typescript/design-system/index.ts in the same commit, or the barrel will import a name that no longer exists.
  • Unused export 'default' mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:239 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused private field 'projectPath' · ×2
  • Unused private field 'projectPath' mpp-ui/src/jsMain/typescript/utils/domainDictUtils.ts:34 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
  • Unused private field 'projectPath' mpp-vscode/src/bridge/mpp-core.ts:640 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 5 of 14 project(s) overshoot their size bounds, lowering Project Cohesion to 2.9/10. The most over is `mpp-idea` (97633 LoC, 2417 module-visible types across 315 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.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 599 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/WebElementSourceMapperTool.kt, mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt, mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/runconfig/RunConfigService.kt, mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt, mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaDiffComponents.kt, mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt, mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt (and 591 more) (608 orphaned of 1333 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; 1333 of the 2316 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning · Large public API surface · ×1
  • Large public API surface — 3033/3140 types (97%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 6/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `mpp-ios`, `mpp-viewer-web`, `mpp-vscode`, `xiuper-fs`.
R7 · Dead Code · Unused export 'WELCOME_MESSAGE' · ×1
  • Unused export 'WELCOME_MESSAGE' mpp-ui/src/jsMain/typescript/constants/asciiArt.ts:13 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'TranslationFunction' · ×1
  • Unused export 'TranslationFunction' mpp-ui/src/jsMain/typescript/i18n/types.ts:131 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'listAvailableSkills' · ×1
  • Unused export 'listAvailableSkills' mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts:158 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getTriggerType' · ×1
  • Unused export 'getTriggerType' mpp-ui/src/jsMain/typescript/utils/commandUtils.ts:191 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatCompletionItem' · ×1
  • Unused export 'formatCompletionItem' mpp-ui/src/jsMain/typescript/utils/commandUtils.ts:204 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'isAtCommand' · ×1
  • Unused export 'isAtCommand' mpp-ui/src/jsMain/typescript/utils/commandUtils.ts:213 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'isSlashCommand' · ×1
  • Unused export 'isSlashCommand' mpp-ui/src/jsMain/typescript/utils/commandUtils.ts:217 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'extractCommand' · ×1
  • Unused export 'extractCommand' mpp-ui/src/jsMain/typescript/utils/commandUtils.ts:221 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'parseContentBlocks' · ×1
  • Unused export 'parseContentBlocks' mpp-ui/src/jsMain/typescript/utils/renderUtils.ts:26 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'SkillManager' · ×1
  • Unused export 'SkillManager' mpp-vscode/src/bridge/mpp-core.ts:636 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'DevInRenderer' · ×1
  • Unused export 'DevInRenderer' mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx:78 — Nothing ultimately consumes this binding: its only referrer is the re-export in mpp-vscode/webview/src/components/sketch/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in mpp-vscode/webview/src/components/sketch/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code · Unused export 'useVSCodeState' · ×1
  • Unused export 'useVSCodeState' mpp-vscode/webview/src/hooks/useVSCode.ts:124 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'AI_PROMPT_TEMPLATE' · ×1
  • Unused module-local declaration 'AI_PROMPT_TEMPLATE' mpp-ui/scripts/generate-test-scenario.js:93 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Write-only private field 'currentToolName' · ×1
  • Write-only private field 'currentToolName' mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:289 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field 'currentToolParams' · ×1
  • Write-only private field 'currentToolParams' mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:290 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field 'currentIteration' · ×1
  • Write-only private field 'currentIteration' mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:19 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Write-only private field 'lastIterationNumber' · ×1
  • Write-only private field 'lastIterationNumber' mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:33 — This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
R7 · Dead Code · Unused private field 'MAX_LINE_LENGTH' · ×1
  • Unused private field 'MAX_LINE_LENGTH' mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:37 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code · Unused module-local declaration 'getCategoryIcon' · ×1
  • Unused module-local declaration 'getCategoryIcon' mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:517 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused private field 'maxTokenLength' · ×1
  • Unused private field 'maxTokenLength' mpp-ui/src/jsMain/typescript/utils/domainDictUtils.ts:36 — Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code · Unused module-local declaration 'TextInRange' · ×1
  • Unused module-local declaration 'TextInRange' mpp-vscode/src/providers/code-element-parser.ts:34 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation · Not all functions that make a request accept an AbortSignal or the coroutine's cancellation · ×1
  • Not all functions that make a request accept an AbortSignal or the coroutine's cancellation — Only 47/49 functions that make a cancellable request (fetch, axios, ky, ofetch; Ktor, OkHttp newCall, URL streams) accept an AbortSignal or the coroutine's cancellation 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` () and hand it to the request; in a Kotlin suspend function, make the request with a call that suspends — Ktor, OkHttp's `executeAsync()`, or a `suspendCancellableCoroutine` that cancels the `Call` — not a blocking `execute()`: `withContext(Dispatchers.IO)` moves the call off the caller's thread but does not make it cancellable; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X9 · Subsumed condition operand · Subsumed condition operand · ×1
  • Subsumed condition operand mpp-core/src/commonTest/kotlin/cc/unitmesh/agent/tool/impl/WriteFileToolIntegrationTest.kt:216 — `it.startsWith(" ")` can never decide this `||` — every value satisfying `it.startsWith(" ")` also satisfies `it.startsWith(" ")`, 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.

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-c836ff5970bf49e1b730c902717afe00/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-c836ff5970bf49e1b730c902717afe00/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 .92artifacts/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-update0artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .2artifacts/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 33 file(s) — `mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/schema/ToolSchema.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt`, `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt`, `mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/filesystem/WasmJsToolFileSystem.kt`, … (+28 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a16fe5-1521-7445-b8b0-49a478f31c50 · 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