Public report of phodal/auto-dev, published 13 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 13 November 2026, 20:54 UTC · Survey ID cd_6a84457638a241cea9d375caa75ffe7b

phodal/auto-dev

Measured 13 November 2026, 20:53 UTC, at code version e8b99f9

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

CAI score 45out of 100 Weak
CriticalWeakAdequateStrongExemplary
No change 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: Security and Compliance, 40

Findings by how serious they are

171 critical 2095 serious 923 minor

15 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 20:53 UTC

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

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

79of 79 dimensions measured by tools.
3168of 3189 findings point to an exact file and line, so you can open each one in the code. The other 21 concern the repository as a whole, such as missing documentation.
79dimensions across 7 lenses, read from 305,170 lines of product code in 16 projects.
Chapters

Executive summary

phodal/auto-dev falls short of our standard for production, in part because we found no encryption of stored data, no key vault and no enforced HTTPS. It scores 45 out of 100 and is rated Weak, and 88 of its 171 critical findings are security problems.

Security and Compliance, at 40, is the weakest lens, level with Accessibility, and counts most in the score. The best first step is encrypting the sensitive stored data and keeping its keys in a vault, worth about 5 points. Making the controls keyboard-usable comes next, worth about 3 points. Raising Security and Compliance to 70 would lift the score to about 50.

Seventy-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Two pipeline steps install packages that can change without warning, and twenty-seven form fields can't be read by a screen reader. Pinning each tool to an exact version, pinning what the pipeline installs and labelling the form fields would close these risks. Limiting each secret to its own step would fix the two secrets exposed to more of the pipeline than needed, and correcting the flagged pipeline settings would deal with the two weaknesses in the build pipeline's configuration. The 13 labels or groups of fields with no name need connecting to their fields or naming.

The product code is 305,170 lines, about €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.
Security and Compliance 40 · counts for 46%Accessibility 40 · counts for 25%Code Health 55 · counts for 14%Production Readiness 56 · counts for 8%Performance 60 · counts for 4%Maturity 67 · counts for 2%Architecture 89 · counts for 1%

If Security and Compliance rose from 40 to 70, the lowest score rated Strong, the score would rise from 45 to about 50.

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

These 943 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Code Duplication · Near-duplicate member family (5 members, 26 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Near-duplicate member family (3 members, 276 shared lines) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Near-duplicate member family (3 members, 57 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt
  • Code Duplication · Near-duplicate member family (3 members, 20 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt
  • Code Duplication · Near-duplicate member pair (146 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt
  • Code Duplication · Near-duplicate member pair (89 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt
  • Code Duplication · Near-duplicate member pair (84 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt
  • Code Duplication · Near-duplicate member pair (83 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt
  • Code Duplication · Near-duplicate member pair (80 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt
  • Code Duplication · Near-duplicate member pair (80 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt
  • Code Duplication · Near-duplicate member pair (65 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Near-duplicate member pair (62 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt
  • Code Duplication · Near-duplicate member pair (61 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt
  • Code Duplication · Near-duplicate member pair (56 shared lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt
  • Code Duplication · Near-duplicate member pair (56 shared lines) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt
  • Code Duplication · Near-duplicate member pair (46 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt
  • Code Duplication · Near-duplicate member pair (40 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt
  • Code Duplication · Near-duplicate member pair (36 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt
  • Code Duplication · Edited copy of a member (17 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) mpp-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt
  • Code Duplication · Edited copy of a member (134 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt
  • Code Duplication · Edited copy of a member (76 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt
  • Code Duplication · Edited copy of a member (85 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt
  • Code Duplication · Edited copy of a member (70 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt
  • Code Duplication · Edited copy of a member (83 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt
  • Code Duplication · Edited copy of a member (79 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt
  • Code Duplication · Edited copy of a member (80 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Code Duplication · Edited copy of a member (89 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Code Duplication · Edited copy of a member (58 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt
  • Code Duplication · Edited copy of a member (70 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt
  • Code Duplication · Edited copy of a member (82 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaThinkingBlockRenderer.kt
  • Code Duplication · Edited copy of a member (91 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt
  • Code Duplication · Edited copy of a member (45 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt
  • Code Duplication · Edited copy of a member (76 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt
  • Code Duplication · Edited copy of a member (60 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt
  • Code Duplication · Edited copy of a member (28 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt
  • Code Duplication · Edited copies of one member (3 members, 54+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt
  • Code Duplication · Edited copy of a member (56 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt
  • Code Duplication · Edited copy of a member (63 corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt
  • Code Duplication · Edited copy of a member (58 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/BaseCompletionTask.kt
  • Code Duplication · Edited copy of a member (50 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt
  • Code Duplication · Edited copy of a member (75 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt
  • Code Duplication · Edited copy of a member (73 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageGenerationModelSelector.kt
  • Code Duplication · Edited copy of a member (53 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt
  • Code Duplication · Edited copy of a member (41 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt
  • Code Duplication · Edited copy of a member (48 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt
  • Code Duplication · Edited copy of a member (55 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt
  • Code Duplication · Edited copy of a member (56 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt
  • Code Duplication · Edited copy of a member (50 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt
  • Code Duplication · Edited copy of a member (47 corresponding lines) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt
  • Code Duplication · Edited copy of a member (35 corresponding lines) mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt
  • Code Duplication · Edited copy of a member (53 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt
  • Code Duplication · Edited copies of one member (3 members, 42+ corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt
  • Code Duplication · Edited copy of a member (39 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Edited copy of a member (44 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt
  • Code Duplication · Edited copy of a member (47 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt
  • Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt
  • Code Duplication · Edited copy of a member (46 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt
  • Code Duplication · Edited copy of a member (44 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt
  • Code Duplication · Edited copy of a member (49 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt
  • Code Duplication · Edited copy of a member (38 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt
  • Code Duplication · Edited copy of a member (50 corresponding lines) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt
  • Code Duplication · Edited copy of a member (44 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt
  • Code Duplication · Edited copy of a member (42 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt
  • Code Duplication · Edited copy of a member (37 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt
  • Code Duplication · Edited copy of a member (42 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt
  • Code Duplication · Edited copy of a member (45 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt
  • Code Duplication · Edited copy of a member (57 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt
  • Code Duplication · Edited copy of a member (38 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (33 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt
  • Code Duplication · Edited copy of a member (51 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt
  • Code Duplication · Edited copy of a member (36 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt
  • Code Duplication · Edited copy of a member (43 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt
  • Code Duplication · Edited copies of one member (3 members, 52+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt
  • Code Duplication · Edited copy of a member (32 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt
  • Code Duplication · Edited copy of a member (45 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt
  • Code Duplication · Edited copy of a member (43 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt
  • Code Duplication · Edited copy of a member (29 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt
  • Code Duplication · Edited copy of a member (42 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt
  • Code Duplication · Edited copy of a member (47 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt
  • Code Duplication · Edited copy of a member (39 corresponding lines) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt
  • Code Duplication · Edited copy of a member (23 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt
  • Code Duplication · Edited copy of a member (45 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt
  • Code Duplication · Edited copy of a member (36 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt
  • Code Duplication · Edited copy of a member (29 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt
  • Code Duplication · Edited copy of a member (22 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt
  • Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt
  • Code Duplication · Edited copy of a member (31 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt
  • Code Duplication · Edited copy of a member (12 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/SchemaLinker.kt
  • Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt
  • Code Duplication · Edited copy of a member (35 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt
  • Code Duplication · Edited copy of a member (36 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt
  • Code Duplication · Edited copy of a member (35 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt
  • Code Duplication · Edited copy of a member (27 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt
  • Code Duplication · Edited copy of a member (25 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt

We compare 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: 780 findings

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

  • Code Duplication · Near-duplicate member family (5 members, 29 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Near-duplicate member family (3 members, 276 shared lines) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Near-duplicate member family (3 members, 52 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt
  • Code Duplication · Near-duplicate member family (3 members, 20 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt
  • Code Duplication · Near-duplicate member pair (141 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt
  • Code Duplication · Near-duplicate member pair (87 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt
  • Code Duplication · Near-duplicate member pair (84 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt
  • Code Duplication · Near-duplicate member pair (83 shared lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.android.kt
  • Code Duplication · Near-duplicate member pair (77 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt
  • Code Duplication · Near-duplicate member pair (77 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt
  • Code Duplication · Near-duplicate member pair (65 shared lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Near-duplicate member pair (40 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt
  • Code Duplication · Near-duplicate member pair (36 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayPanel.kt
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt
  • Code Duplication · 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
  • Code Duplication · 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
  • Code Duplication · Duplicated block (144–146 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt
  • Code Duplication · Duplicated block (108 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (87 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt
  • Code Duplication · Duplicated block (82 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (74–75 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt
  • Code Duplication · Duplicated block (71 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt
  • Code Duplication · Duplicated block (55–56 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt
  • Code Duplication · Duplicated block (53 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt
  • Code Duplication · Duplicated block (52 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt
  • Code Duplication · Duplicated block (51 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt
  • Code Duplication · Duplicated block (30–51 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt
  • Code Duplication · Duplicated block (30–51 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt
  • Code Duplication · Duplicated block (49 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt
  • Code Duplication · Duplicated block (47–48 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt
  • Code Duplication · Duplicated block (46 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.android.kt
  • Code Duplication · Duplicated block (45–46 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Duplicated block (45 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (42 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt
  • Code Duplication · Duplicated block (41 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterRegistry.js.kt
  • Code Duplication · Duplicated block (41 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt
  • Code Duplication · Duplicated block (33–41 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt
  • Code Duplication · Duplicated block (41 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt
  • Code Duplication · Duplicated block (40 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt
  • Code Duplication · Duplicated block (38 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt
  • Code Duplication · Duplicated block (31–35 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt
  • Code Duplication · Duplicated block (35 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt
  • Code Duplication · Duplicated block (33–35 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt
  • Code Duplication · Duplicated block (34 lines × 4) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt
  • Code Duplication · Duplicated block (34 lines × 3) mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Duplicated block (34 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt
  • Code Duplication · Duplicated block (34 lines × 2) mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.ios.kt
  • Code Duplication · Duplicated block (34 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Code Duplication · Duplicated block (28–34 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt
  • Code Duplication · Duplicated block (28–34 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt
  • Code Duplication · Duplicated block (32–34 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt
  • Code Duplication · Duplicated block (32 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt
  • Code Duplication · Duplicated block (32 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Duplicated block (32 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Duplicated block (32 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt
  • Code Duplication · Duplicated block (32 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt
  • Code Duplication · Duplicated block (31 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Duplicated block (31 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt
  • Code Duplication · Duplicated block (31 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt
  • Code Duplication · Duplicated block (30–31 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt
  • Code Duplication · Duplicated block (30 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt
  • Code Duplication · Duplicated block (28–30 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt
  • Code Duplication · Duplicated block (29 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt
  • Code Duplication · Duplicated block (29 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt
  • Code Duplication · Duplicated block (29 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt
  • Code Duplication · Duplicated block (26–28 lines × 4) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt
  • Code Duplication · Duplicated block (28 lines × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt
  • Code Duplication · Duplicated block (28 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt
  • Code Duplication · Duplicated block (28 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt
  • Code Duplication · Duplicated block (28 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt
  • Code Duplication · Duplicated block (27–28 lines × 2) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt
  • Code Duplication · Duplicated block (28 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (27 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/ViewerWebView.android.kt
  • Code Duplication · Duplicated block (27 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt
  • Code Duplication · Duplicated block (25–27 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt
  • Code Duplication · Duplicated block (27 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt
  • Code Duplication · Duplicated block (27 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt
  • Code Duplication · Duplicated block (26 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (25–26 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DetektLinter.kt
  • Code Duplication · Duplicated block (26 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt
  • Code Duplication · Duplicated block (26 lines × 2) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt
  • Code Duplication · Duplicated block (26 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt
  • Code Duplication · Duplicated block (24–26 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt
  • Code Duplication · Duplicated block (25–26 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/platform/FileChooser.android.kt
  • Code Duplication · Duplicated block (26 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt
  • Code Duplication · Duplicated block (25 lines × 5) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt
  • Code Duplication · Duplicated block (25 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt
  • Code Duplication · Duplicated block (25 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/AIAnalysisSection.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/executor/NodeJsArtifactExecutor.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt
  • Code Duplication · Duplicated block (25 lines × 2) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt
  • Code Duplication · Duplicated block (20–24 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt
  • Code Duplication · Duplicated block (24 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt
  • Code Duplication · Duplicated block (23–24 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/CodeReviewAgentExecutor.kt
  • Code Duplication · Duplicated block (24 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeContent.kt
  • Code Duplication · Duplicated block (24 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/SessionSidebar.kt
  • Code Duplication · Duplicated block (23–24 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt
Rebuild cost: about €320,000 · Estimate
Cost to rebuild€110,000 to €530,000, for 1,762 to 5,590 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 45. 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
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
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 5 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 Security and Compliance, at 40 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance 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 5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change.
How this is estimated: It rests on an assumption of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4)
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch @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.

1560 modules, with 2010 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; 1520 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+1520 more modules (most-connected shown)

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

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

At a glance — Maturity · 67% · Adequate ·

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

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

At a glance — Accessibility · 40% · 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 — Injection96High / Critical
A03:2025 — Software Supply Chain Failures11High / Critical
A02:2025 — Security Misconfiguration2Medium

Roadmap

Top priorities: 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.); Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href; Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.

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.9 ptsMediumData Protection
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.8 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.+1.9 ptsMediumText alternatives
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+0.8 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+0.8 ptsLowStatic Analysis (SAST)
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED.+0.8 ptsLowStatic Analysis (SAST)
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+0.8 ptsLowDependency Vulnerabilities
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.5 ptsMediumForms & labels

File quality

Per-file score 0–10 — a quality signature. Of 659 files carrying findings, judged against the Production bar: 1% slop · 55% mixed · 44% 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.2SlopChange 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.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt5.0MixedChange Coupling: Boundary-crossing change coupling: StatefulNanoRenderer.kt ↔ HtmlRenderer.kt
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.6MixedCode Duplication: Duplicated block (28 lines × 2)
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt5.7MixedCyclomatic Complexity: DocumentCli.main (cyclomatic 50)
mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentApp.kt5.9MixedCyclomatic Complexity: IdeaAgentAppKt.IdeaAgentApp (cyclomatic 53)
mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt5.9MixedCode Duplication: Edited copy of a member (22 corresponding lines)
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

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

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

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

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

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

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

What we checked — 79 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D17D19D20D21D24D26D27D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX9C1M1M2M3M4P1P10P2P3P4P6P7PF3R1R10R2R3R4R6R7R8R9S1X1X12X13X16X17X18X19X2X21X23X25X26X27X28X29X3X30X4X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1d6af-6c37-7e86-9804-d200e02c7204.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .kt, and the jvm executor ran against the .kt half and did not finish re-running within its tier budget — 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Gradle build resolved 1591 artifact(s) across its subprojects (1223 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its JVM dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoState.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.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — 28 | COPY mpp-core/AutoDevCore.podspec ./mpp-core/ 29 | >>> COPY mpp-core/webpack.config.d ./mpp-core/webpack.config.d 30 | 31 | # Build fat JAR -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref d58e7bfe-74ad-4acd-bde3-180c73166c5c::13fd4j6j2nt1fhhhhfe8vmw73: "/mpp-core/webpack.config.d": not found; runtime evidence skipped.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P2 Observability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 37 further occurrence(s) are not listed individually; the score already reflects all 77.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1 further occurrence(s) are not listed individually; the score already reflects all 41.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 119 further occurrence(s) are not listed individually; the score already reflects all 159.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned REDACTED, 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic 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.

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
DiffFormatter.postProcess (cognitive 23) · ×2mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:18
WebEditVisionHelperKt.createWebEditVisionHelper (cognitive 23) · ×2mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditVisionHelper.kt:50
CodeFence.parseMarkdownContent (cognitive 19) · ×2mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:202

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

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

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

D4 · Code Duplication5.8 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

658 duplicated block group(s) detected. 10.6 % of the production lines (32,363 of 305,170) are in a reported copy. A further 354 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 1012 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (12 lines × 2) · ×34mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:82
Duplicated block (13 lines × 2) · ×33mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:293
Duplicated block (11 lines × 2) · ×33mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:121
Duplicated block (9 lines × 2) · ×30mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/view/MessageView.kt:137
Duplicated block (14 lines × 2) · ×27mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:307

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

What to do

  1. Resolve the 34 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 (34 warning-level).
  2. Resolve the 33 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with ProjectListScreen.kt (2), IosCodeParser.kt, GitHubPRReviewService.kt. — One of this dimension's main actionable groups (33 warning-level).
  3. Resolve the 33 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with WorkflowController.kt (2), StructuredInfoPane.kt (2), DiffFormatter.kt. — One of this dimension's main actionable groups (33 warning-level).

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

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, LLMModelManager.kt, DocumentCli.kt. — One of this dimension's main actionable groups (10 warning-level).

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

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

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

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

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 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.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

1 of 124 declared JVM dependency artifact(s) use a banned license. Licences were resolved from the POMs Maven Central publishes, over the coordinates this repository's 12 Maven/Gradle manifest(s) declare with a version resolvable from the manifest itself — the same declaration-site closure this analysis reads for dependency currency. The JVM has no lockfile a checkout is guaranteed to carry, so this is deliberately NOT the transitive closure. 7 further coordinate(s) are declared with no version at the declaration site — inherited from a parent POM, a BOM or an unresolved Gradle version reference — and are NOT graded: this verdict covers what the checkout pins, not the full transitive graph. A further 7 coordinate(s) are not published to Maven Central — another repository (Google's Maven hosts androidx), a SNAPSHOT, or a private artifact — so their licences are not readable from here and they are outside this verdict. ★ COVERAGE OF THIS VERDICT: it grades this repository's JVM dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: com.mysql:mysql-connector-j

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.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 · ×92xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/DataProps.kt:157

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

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

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

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

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

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

2 of 2 documentation facets pass in full. 25 document(s) read across 5 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs foundrender.yaml:1

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with render.yaml. — 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 Consistency5.2 / 10Adequate✓ Tool-verified

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

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

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

9 naming inconsistencies among 189 declarations measured against a convention their peers follow.

`parseJSNodes` spells `JS` where 44 names in the project spell it `Js`mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:179
`SchemaLinkingLlmResult` spells `Llm` where 36 names in the project spell it `LLM`mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/LlmSchemaLinker.kt:72
`invalidSQL` spells `SQL` where 27 names in the project spell it `Sql`mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.kt:448
`parseSQLFluffOutput` spells `SQL` where 27 names in the project spell it `Sql`mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SQLFluffLinter.kt:25
`inShadowDom` spells `Dom` where 12 names in the project spell it `DOM`mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/model/PageState.kt:166

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

What to do

  1. Resolve the 1 `parseJSNodes` spells `JS` where 44 names in the project spell it `Js` finding(s) in Naming Consistency — start with AndroidCodeParserFactory.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `SchemaLinkingLlmResult` spells `Llm` where 36 names in the project… finding(s) in Naming Consistency — start with LlmSchemaLinker.kt. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `invalidSQL` spells `SQL` where 27 names in the project spell it `Sql` finding(s) in Naming Consistency — start with DatabaseConnection.kt. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value0.6 0.4 / 10Critical✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 0.4 / 10 · rule-coverage 64% · ceiling Documented

78 of 830 judged comments only repeat the code they sit on (9.4 %). 646 comment(s) in another language or script were not judged.

redundant comment · ×50mpp-ui/scripts/convert-icon.js:14
doc comments repeat the names · ×2mpp-ui/scripts/generate-test-report.js:103

What to do

  1. Resolve the 50 redundant comment finding(s) in Comment Value — start with LLMService.ts (4), AgentMode.test.ts (3), ChatInterface.tsx (3). — One of this dimension's main actionable groups (50 recommendation-level).

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

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.

D27 · Navigability9.7 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

11 % of calls cross a namespace and 5 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)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.6 / 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.6 / 10 · rule-coverage 100% · ceiling Documented

96 finding(s): 0 critical, 87 high, 9 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

+ 8 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 / 10Adequategated by 1 critical finding○ 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

REDACTED
REDACTED

What to do

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

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

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

640 of 1334 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 1334 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 · ×631mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/AcpAgentConfigDialog.kt:1
Further orphaned files (smaller)

What to do

  1. Resolve the 631 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 (631 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. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

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

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

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 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.2 / 10Weak✓ Tool-verified

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

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

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

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — mpp-idea/mpp-idea-core/src/main/resources/genius/en/page/page-gen-design.vm:15, mpp-idea/mpp-idea-core/src/main/resources/genius/en/page/page-gen-design.vm:16, mpp-idea/mpp-idea-core/src/main/resources/genius/zh/page/page-gen-design.vm:15, …
  • 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. (×17) — 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.2 / 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
  • `button` sets color: white on background-color: #2196F3 — 3.1:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — mpp-viewer-web/src/jvmMain/resources/test-shadow-dom.html:28
  • The inline foreground/background colours fall below the 4.5:1 WCAG AA minimum for normal text. Darken/lighten one of them. — mpp-web/src/App.tsx:293
  • `.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
  • `.diff-action-btn.reject` 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/DiffRenderer.css:62
  • `.diff-applied-overlay` 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:119
  • `.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.
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.

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.

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/DataSource.sq:9

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

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

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

What to do

  • 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.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

M4 · Documentation accuracy6.0 / 10Adequate✓ Tool-verified

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

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

  • 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-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-ios/README.md links to `PODFILE-CONFIG.md`, but `mpp-ios/PODFILE-CONFIG.md` does not exist; 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.
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 & versioning9.7 / 10Exemplary✓ 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's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

  • 81 public types in `cc.unitmesh.agent.tool.impl` are marked as implementation by their own namespace, folder or name: `AndroidCodeParserFactoryKt` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:1, `impl`), `AskSubAgentParams` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:14, `impl`), `AskSubAgentSchema` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:23, `impl`), `AskAgentTool` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:50, `impl`), `CodebaseInsightsToolKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:1, `impl`), `CodebaseInsightsSchema` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:24, `impl`), `CodebaseInsightsParams` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:48, `impl`), `CodebaseInsightsResult` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:58, `impl`), and 73 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:1
  • 12 public types in `cc.unitmesh.agent.tool.impl.http` are marked as implementation by their own namespace, folder or name: `HttpClientFactory` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:15, `impl`), `HttpFetcherFactory` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpFetcherFactory.android.kt:8, `impl`), `KtorHttpFetcher` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:20, `impl`), `ParsedUrls` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:6, `impl`), `UrlParser` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:14, `impl`), `NodeFetchHttpFetcher` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:17, `impl`), `AbortController` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:138, `impl`), `AbortSignal` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:143, `impl`), and 4 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:15
  • 1 public type in `cc.unitmesh.agent.tool.impl.DocQLTool` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/DocQLTool.kt:494, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/DocQLTool.kt:494
  • 1 public type in `cc.unitmesh.agent.tool.impl.GlobInvocation` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:93, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:93
  • 5 public types in `cc.unitmesh.agent.tool.impl.PlanAction` are marked as implementation by their own namespace, folder or name: `CREATE` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `UPDATE` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `COMPLETE_STEP` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `FAIL_STEP` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `VIEW` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14
  • 21 public types in `cc.unitmesh.agent.tool.impl.docql` are marked as implementation by their own namespace, folder or name: `DocQLDirectQueryExecutorKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:1, `impl`), `DocQLDirectQueryExecutor` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:17, `impl`), `DocQLKeywordSearchExecutorKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLKeywordSearchExecutor.kt:1, `impl`), `DocQLKeywordSearchExecutor` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLKeywordSearchExecutor.kt:33, `impl`), `DocQLResultFormatter` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:16, `impl`), `DocQLResultRerankerKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:1, `impl`), `DocQLResultReranker` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:31, `impl`), `SearchItem` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:206, `impl`), and 13 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:1
  • 2 public types in `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats` are marked as implementation by their own namespace, folder or name: `SearchType` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:56, `impl`), `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:137, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:56
  • 4 public types in `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats.SearchType` are marked as implementation by their own namespace, folder or name: `SMART_SEARCH` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:57, `impl`), `DIRECT_QUERY` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:58, `impl`), `FALLBACK_CONTENT` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:59, `impl`), `LLM_RERANKED` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:60, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:57
  • 1 public type in `cc.unitmesh.agent.tool.impl.docql.RerankerStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:184, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:184
  • 1 public type in `cc.unitmesh.agent.tool.impl.docql.ScoringStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:212, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:212
  • 1 public type in `cc.unitmesh.agent.tool.impl.docql.KeywordExpansionStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:249, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:249
  • 1 public type in `cc.unitmesh.agent.tool.impl.docql.LLMRerankerStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:291, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:291
  • 1 public type in `cc.unitmesh.agent.tool.impl.http.KtorHttpFetcher` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:104, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:104
  • 1 public type in `cc.unitmesh.agent.tool.impl.http.NodeFetchHttpFetcher` is marked as implementation by its own namespace, folder or name: `jsKt` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:1, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:1

What to do

  • Hide `cc.unitmesh.agent.tool.impl` (`AndroidCodeParserFactoryKt`, `AskSubAgentParams`, `AskSubAgentSchema`, `AskAgentTool`, `CodebaseInsightsToolKt`, `CodebaseInsightsSchema`, `CodebaseInsightsParams`, `CodebaseInsightsResult`, and 73 more) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.http` (`HttpClientFactory`, `HttpFetcherFactory`, `KtorHttpFetcher`, `ParsedUrls`, `UrlParser`, `NodeFetchHttpFetcher`, `AbortController`, `AbortSignal`, and 4 more) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.DocQLTool` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.GlobInvocation` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.PlanAction` (`CREATE`, `UPDATE`, `COMPLETE_STEP`, `FAIL_STEP`, `VIEW`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql` (`DocQLDirectQueryExecutorKt`, `DocQLDirectQueryExecutor`, `DocQLKeywordSearchExecutorKt`, `DocQLKeywordSearchExecutor`, `DocQLResultFormatter`, `DocQLResultRerankerKt`, `DocQLResultReranker`, `SearchItem`, and 13 more) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats` (`SearchType`, `Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats.SearchType` (`SMART_SEARCH`, `DIRECT_QUERY`, `FALLBACK_CONTENT`, `LLM_RERANKED`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.RerankerStats` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.ScoringStats` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.KeywordExpansionStats` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.docql.LLMRerankerStats` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.http.KtorHttpFetcher` (`Companion`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
  • Hide `cc.unitmesh.agent.tool.impl.http.NodeFetchHttpFetcher` (`jsKt`) (Kotlin: `internal`; Swift: leave it `internal` (the default) instead of `public`): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
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/webpack.config.d/node-polyfills.js` reports through `console.*` at line 77 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/webpack.config.d/node-polyfills.js:77
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 48 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/utils/commandUtils.ts:48
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 55 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/utils/commandUtils.ts:55
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 57 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/utils/commandUtils.ts:57
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 60 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/utils/commandUtils.ts:60
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 63 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/utils/commandUtils.ts:63
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 66 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/utils/commandUtils.ts:66
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 67 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/utils/commandUtils.ts:67
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 86 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/utils/commandUtils.ts:86
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 88 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/utils/commandUtils.ts:88
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 91 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/utils/commandUtils.ts:91
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 92 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/utils/commandUtils.ts:92
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 110 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/utils/commandUtils.ts:110
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 148 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/utils/commandUtils.ts:148
  • `mpp-ui/src/jsMain/typescript/utils/commandUtils.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/utils/commandUtils.ts:169
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 28 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/utils/outputFormatter.ts:28
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 29 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/utils/outputFormatter.ts:29
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 30 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/utils/outputFormatter.ts:30
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 37 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/utils/outputFormatter.ts:37
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 44 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/utils/outputFormatter.ts:44
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 51 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/utils/outputFormatter.ts:51
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 58 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/utils/outputFormatter.ts:58
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.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/utils/outputFormatter.ts:65
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 73 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/utils/outputFormatter.ts:73
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 82 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/utils/outputFormatter.ts:82
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.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/utils/outputFormatter.ts:89
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 97 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/utils/outputFormatter.ts:97
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 106 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/utils/outputFormatter.ts:106
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.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/utils/outputFormatter.ts:107
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 111 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/utils/outputFormatter.ts:111
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 122 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/utils/outputFormatter.ts:122
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 126 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/utils/outputFormatter.ts:126
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 128 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/utils/outputFormatter.ts:128
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 130 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/utils/outputFormatter.ts:130
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 132 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/utils/outputFormatter.ts:132
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 150 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/utils/outputFormatter.ts:150
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 151 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/utils/outputFormatter.ts:151
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 152 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/utils/outputFormatter.ts:152
  • `mpp-ui/src/jsMain/typescript/utils/outputFormatter.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/utils/outputFormatter.ts:153

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

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:5

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).
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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

R10 · Code Duplication5.3 / 10Adequate✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 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
  • REDACTED:113 · REDACTED: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. — REDACTED: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-vscode/webview/src/components/plan/PlanSummaryBar.tsx:65 · mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:213 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:65
  • 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

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
  • handleDeepResearchCommand has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:374
  • splitTopLevelDeclarators has cyclomatic complexity 18 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1929
  • runServerAgent has cyclomatic complexity 18 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:249
  • readVariableDeclaratorPattern has cyclomatic complexity 17 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/node-repl/NodeReplRuntime.ts:1807
  • findTopLevelCharacter has cyclomatic complexity 17 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/node-repl/NodeReplRuntime.ts:1888
  • handleInput has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:69
  • generateTestReport has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/test/framework/reporters/ConsoleReporter.ts:15
  • handleInput has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:127
  • ChatInput has cyclomatic complexity 17 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-vscode/webview/src/components/ChatInput.tsx:32
  • formatToolParams has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:206
  • parseMarkdownFindings has cyclomatic complexity 16 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/modes/ReviewMode.ts:323
  • parseMarkdownContent has cyclomatic complexity 16 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-vscode/webview/src/utils/codeFence.ts:158
  • process has cyclomatic complexity 16 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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/processors/ModeCommandProcessor.ts:39
  • handleToolCall has cyclomatic complexity 16 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 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/server.ts:180
  • generateToolSummary has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:426
  • DevInToolItem has cyclomatic complexity 16 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx:117
  • formatParams has cyclomatic complexity 16 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:45
  • parseCodeBlocks has cyclomatic complexity 15 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-vscode/webview/src/utils/codeFence.ts:60
  • analyzeTestResults has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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:12
  • main has cyclomatic complexity 15 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 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/publish-remote.js:44
  • formatLLMError has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169
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)
  • Declared in mpp-vscode/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. (×2)

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-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/startup/ShireFileModifier.kt:52, mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/CustomRemoteAgentLlmExecutor.kt:37, mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/runner/ShireDefaultLlmExecutor.kt:62, …

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 `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/search/RipgrepSearcher.kt:77, mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:133, 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 `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

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.
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, got, undici, node:http; 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.
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.

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.

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 (_: 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. (×14) — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:272, mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:411, mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:419, …
  • `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. (×14) — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:974, xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:988, xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1157, …
  • `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. (×2) — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:51, xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:477
  • 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. (×10) — mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:67, mpp-vscode/src/providers/devins-completion.ts:58, mpp-vscode/src/actions/auto-actions.ts:139, …

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 271 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/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:271
  • `warn` 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.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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:42
  • `info` at line 89 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:89
  • `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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:92
  • `info` at line 136 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:136
  • `warn` at line 142 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:142
  • `warn` at line 145 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:145
  • `warn` at line 167 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:167
  • `error` 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.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. (×2) — mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:66, mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:66
  • `error` at line 94 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:94
  • `error` at line 34 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:34
  • `error` at line 53 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:53
  • `error` at line 64 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:64
  • `info` 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.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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:67
  • `warn` at line 78 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:78
  • `info` at line 94 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:94
  • `error` at line 126 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:126
  • `error` at line 132 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:132
  • `info` 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.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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptContextProvider.kt:35
  • `warn` at line 54 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:54
  • `error` at line 60 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:60
  • `warn` at line 156 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:156
  • `error` at line 73 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-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:73
  • `error` at line 100 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-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:100
  • `info` at line 90 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-lang/java/src/main/kotlin/cc/unitmesh/idea/prompting/JavaContextPrompter.kt:90
  • `warn` at line 51 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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:51
  • `warn` at line 85 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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:85
  • `error` 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.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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:117
  • `error` at line 129 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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:129
  • `error` at line 134 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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:134
  • `error` at line 144 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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaCodeModifier.kt:144
  • `warn` 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.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-lang/java/src/main/kotlin/cc/unitmesh/idea/context/JavaContextCollection.kt:97
  • `info` at line 110 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-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CodeReviewAction.kt:110
  • `info` at line 205 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-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:205
  • `error` at line 122 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-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/GitRevisionProvider.kt:122
  • `info` at line 32 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-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlBackgroundTask.kt:32
  • `warn` at line 41 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-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlBackgroundTask.kt:41
  • `error` at line 63 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-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlBackgroundTask.kt:63
  • `info` at line 53 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-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlFlow.kt:53

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

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 Health55%AdequateAcceptable, with room to improve.
Architecture89%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity67%AdequateStrongest area.
Readiness56%Adequate — gated by R4, R8, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security40%Weak — gated by D29, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility40%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 — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • 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 — 41 check(s) not relevant to this codebase

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

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — AX6 reached only 9% of this repository's production lines — kotlin (280,991 lines), swift (606 lines), python (377 lines), c (7 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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) — 28 | COPY mpp-core/AutoDevCore.podspec ./mpp-core/ 29 | >>> COPY mpp-core/webpack.config.d ./mpp-core/webpack.config.d 30 | 31 | # Build fat JAR -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref d58e7bfe-74ad-4acd-bde3-180c73166c5c::13fd4j6j2nt1fhhhhfe8vmw73: "/mpp-core/webpack.config.d": not found; 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 — a Gradle build resolved 1591 artifact(s) across its subprojects (1223 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift, TypeScript surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • 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.
  • 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.
  • 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 example/ 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `@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.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — 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
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 9% of this repository's production lines — kotlin (280,991 lines), swift (606 lines), c (7 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.

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 — 171 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 · ×22
  • <input> without a programmatic label mpp-idea/mpp-idea-core/src/main/resources/genius/en/page/page-gen-design.vm:15 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-idea/mpp-idea-core/src/main/resources/genius/en/page/page-gen-design.vm:16 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-idea/mpp-idea-core/src/main/resources/genius/zh/page/page-gen-design.vm:15 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label mpp-idea/mpp-idea-core/src/main/resources/genius/zh/page/page-gen-design.vm:16 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label 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-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.
  • `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/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/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/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/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-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-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.
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 · <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.
AC2 · Forms & labels · <textarea> without a programmatic label · ×2
  • <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.
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>.
D14 · License Compliance · Banned license · ×1
  • Banned license: com.mysql:mysql-connector-j — `com.mysql:mysql-connector-j` 9.0.0 is published on Maven Central under `GPL-2.0`, which this policy bans, and this repository declares it in a Maven or Gradle manifest. The licence was read from the artifact's POM `<licenses>` block — following `<parent>` where the POM inherits them — and normalised to SPDX before it was judged, because Maven publishes the name as free text (`GNU Affero General Public License v3` is AGPL-3.0). Where a POM lists several licences they are read as a CHOICE, per Maven's own documentation, so this is charged only because EVERY listed licence is banned. Replace the dependency, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×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 — 2095 finding(s)
D17 · Explicit Debt · TodoComment · ×92
  • TodoComment xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/DataProps.kt:157 — // TODO: parse from props — 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 xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.wasmJs.kt:63 — // TODO: Implement actual MCP client creation for 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 xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.jvm.kt:124 — // TODO: Fix MCP SDK content access - API structure needs investigation — 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 xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.jvm.kt:210 — // TODO: Implement actual MCP client creation based on serverConfig — 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 xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.js.kt:63 — // TODO: Implement actual MCP client creation for JS — 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 xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:64 — // TODO: Implement actual MCP client creation for Android — 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-vscode/webview/src/components/sketch/SketchRenderer.tsx:112 — // TODO: Implement MermaidRenderer — 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-vscode/webview/src/components/sketch/SketchRenderer.tsx:137 — // TODO: Implement PlanRenderer — 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-vscode/src/providers/chat-view.ts:782 — // TODO: Show diff view — 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-vscode/src/providers/chat-view.ts:789 — // TODO: Apply diff — 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-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.wasmJs.kt:154 — // TODO: Implement using JavaScript callback mechanism similar to getSelectedElementHtml — 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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:165 — // TODO: Implement using JavaScript callback mechanism similar to getSelectedElementHtml — 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-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.wasmJs.kt:9 — // TODO: Implement using Clipboard 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-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.wasmJs.kt:14 — // TODO: Implement using Clipboard 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-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.js.kt:9 — // TODO: Implement using Clipboard 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-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.js.kt:14 — // TODO: Implement using Clipboard 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-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:172 — // TODO: Handle bytes binding if needed, complex in 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:231 — // TODO: Support multiple images in MultimodalLLMService — 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-ui/src/jsMain/typescript/index.tsx:140 — // TODO: Re-enable after fixing Kotlin/JS interface type handling — 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-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:511 — // TODO: Implement terminal integration via ACP — 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-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.ios.kt:9 — // TODO: Implement using UIPasteboard — 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-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/platform/ClipboardImageReader.ios.kt:14 — // TODO: Implement using UIPasteboard — 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-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:29 — // TODO: Integrate with native WKWebView for full preview support — 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-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:80 — // TODO: Implement iOS export using share sheet — 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-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.ios.kt:92 — // TODO: Implement iOS bundle export using share sheet — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×34
  • Duplicated block (12 lines × 2) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:82 — mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:82-93 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:128-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:82` 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/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/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:402 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:402-413 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:473-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:402` 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 4 separate duplicated blocks between them, totalling at least 87 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 56 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/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-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-63 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt:55-66 — 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 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.
  • 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.
  • + 9 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×33
  • 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:135 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:135-147 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:104-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:135` it does not close everything it opens, so those 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-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/a2a/ui/A2AAgentCardPanel.kt:130 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:130-142 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListCardPanel.kt:102-114 — 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/A2AAgentCardPanel.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.
  • 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/components/timeline/IdeaToolCallBubble.kt:201 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:201-213 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:268-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:201` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • 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 227 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/db/DatabaseDriverFactory.kt:49 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/db/DatabaseDriverFactory.kt:49-61 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/db/DatabaseDriverFactory.kt:68-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 `xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/db/DatabaseDriverFactory.kt:68` 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.
  • 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 3 separate duplicated blocks between them, totalling at least 57 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/compose/agent/codereview/IssueTrackerConfigDialog.kt:164 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/IssueTrackerConfigDialog.kt:164-176 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/CloudStorageConfigDialog.kt:140-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. 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/IssueTrackerConfigDialog.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 (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 4 separate duplicated blocks between them, totalling at least 75 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×33
  • 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/gui/snippet/AutoDevSaveFileAction.kt:42 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevSaveFileAction.kt:42-53 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaCodeActions.kt:92-102 — 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/snippet/AutoDevSaveFileAction.kt:42` 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-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/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/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/codereview/diff/DiffFileTreeView.kt:294 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:294-304 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:375-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/DiffFileTreeView.kt:294` it does not close everything it opens, so those 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) 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/linecount/CmdWrapper.kt:100-110 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/agent/tool/search/RipgrepSearcher.kt:133-143 — 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/agent/tool/linecount/CmdWrapper.kt:100` 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:194 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:194-204 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:225-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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: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. ★ 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/sketch/chart/IdeaChartRenderer.kt:192` calls `drawGridLines` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:223` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:58 — mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:58-68 | xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/config/ConfigLoader.kt:41-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: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. ★ 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 (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/agent/tool/impl/GlobTool.kt:264 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:264-274 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GrepTool.kt:312-323 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) 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.
  • + 8 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.
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 (9 lines × 2) · ×30
  • 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/editor/IdeaFileSearchPopup.kt:58 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:58-66 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelSelector.kt:59-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.
  • 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-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:174 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:174-182 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.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-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-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:136 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.android.kt:136-144 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:186-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. 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-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:146 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:146-154 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/config/ToolConfigExports.kt:119-127 — 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/CodingAgentExports.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 (9 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:123 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:123-131 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaPlanRenderer.kt:92-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. 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-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 147 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.
  • + 5 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×30
  • Swallowed exception (caught, then discarded) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:272 — `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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:974 — `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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:988 — `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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1157 — `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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:51 — `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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:477 — `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) xiuper-fs/src/wasmJsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.wasmJs.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) xiuper-fs/src/jvmMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.jvm.kt:213 — `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) xiuper-fs/src/jsMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.js.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) xiuper-fs/src/androidMain/kotlin/cc/unitmesh/xiuper/fs/mcp/McpBackend.android.kt:66 — `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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:411 — `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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:419 — `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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:427 — `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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:435 — `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-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:443 — `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-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:402 — `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-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:410 — `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-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:418 — `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-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:426 — `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-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:222 — `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-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:402 — `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-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:410 — `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-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:418 — `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-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:426 — `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-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.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.
  • + 5 more in this group — see findings.md.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×28
  • 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 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.
  • Sync-over-async blocking mpp-vscode/src/services/config-manager.ts:122 — `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.
  • Sync-over-async blocking mpp-vscode/src/services/config-manager.ts:125 — `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.
  • Sync-over-async blocking mpp-vscode/src/services/config-manager.ts:129 — `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.
  • + 3 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 (14 lines × 2) · ×27
  • 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/clustering/CodeGraphClusterer.kt:213 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:213-226 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:353-366 — 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/indexer/clustering/CodeGraphClusterer.kt:213` it does not close everything it opens, so those 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, `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:227` calls `toString` and `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:367` 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 × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:363 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:363-376 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:431-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:363` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) 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/gui/snippet/AutoDevInsertCodeAction.kt:48 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevInsertCodeAction.kt:48-61 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaCodeActions.kt:54-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.
  • 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/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-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:861 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:861-874 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:959-972 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:861` 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/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-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:209 — mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/CommitMessageSuggestionAction.kt:209-222 | mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/provider/GitToolchainVariableProvider.kt:171-184 — 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 (14 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:99 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:99-112 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt:175-188 — 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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `null` to `psi) val buildInfo = BuildSystemProvider.guess(project).firstOrNull() val buildTool = if (buildInfo !=` in one and `element = psi) val buildInfo = BuildSystemProvider.guess(project).firstOrNull() val buildTool = if (buildInfo !=` 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-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/RunService.kt:107 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/RunService.kt:107-120 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlBackgroundTask.kt:79-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 (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/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.
  • 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×27
  • Duplicated block (10 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.android.kt:57 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.android.kt:57-66 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.jvm.kt:53-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-core/src/androidMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.android.kt:57` 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-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.jvm.kt:65` calls `when`, `validateBundle` and `mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundlePacker.android.kt:68` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 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/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/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-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:239 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:239-248 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:161-170 — 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/DocumentCli.kt:239` 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-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:76 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:76-85 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/model/DomainDictionary.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. 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: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.
  • Duplicated block (10 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:147 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:147-156 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:41-50 — 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/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:165 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:165-176 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/external/ExternalCliCodingAgent.kt:187-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/external/ExternalCliCodingAgent.kt:165` it does not close everything it opens, so those 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-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-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/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) 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.
  • 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) 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×24
  • 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-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeAction.kt:15 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeAction.kt:15-22 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeDisposedAction.kt:17-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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-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 — before extracting anything, compare `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt` and `mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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-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) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1025 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1025-1032 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1181-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1025` it does not close everything it opens, so those 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 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:361 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:361-368 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentReaderViewModel.kt:454-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:361` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:178 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:178-185 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/DevInsParser.kt:368-375 — both copies are in the same file, so extract the 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/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-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PylintLinter.kt:26 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PylintLinter.kt:26-33 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SwiftLintLinter.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/PylintLinter.kt:26` it does not close everything it opens, so those 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-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:193 — mpp-server/src/main/kotlin/cc/unitmesh/server/plugins/SessionRouting.kt:193-200 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/WorkflowController.kt:175-182 — 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: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. 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 (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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×21
  • 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 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. 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 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. 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/components/timeline/IdeaToolCallBubble.kt:81 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:81-95 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDevInBlockRenderer.kt:105-119 — 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/components/timeline/IdeaToolCallBubble.kt:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `modifier` to `Modifier = Modifier` in one and `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.
  • Duplicated block (15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:182 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:182-196 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:219-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:182` 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/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 227 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-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-317 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:286-300 — 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 4 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-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 (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/nano/components/input/InputComponents.kt:284 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:284-298 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:305-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:284` 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/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 6 separate duplicated blocks between them, totalling at least 112 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-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:224 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:224-238 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:207-221 — 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 6 separate duplicated blocks between them, totalling at least 112 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: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 (15 lines × 2) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:70 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:70-84 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:71-85 — 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 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. 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: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.
  • Duplicated block (15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:357 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:357-371 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:484-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 227 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. ★ 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 (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 6 separate duplicated blocks between them, totalling at least 250 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.
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: 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: 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: 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: 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: 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: 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: 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: 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 (16 lines × 2) · ×18
  • 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-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/components/IdeaResizableSplitPane.kt:94 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:94-109 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:94-109 — 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/components/IdeaResizableSplitPane.kt:94` 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/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 4 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. 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/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/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:33 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:33-48 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:33-48 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt` as WHOLE FILES: this scan already matched 3 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. 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: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.
  • 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 79 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×15
  • Edited copy of a member (15 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/SelectionProps.kt:23 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/SelectionProps.kt:23-37 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/SelectionProps.kt:57-71 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:354 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:354-368 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentReaderViewModel.kt:446-461 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:64 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:64-78 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:895-921 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRelatedClassesProvider.kt:146 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRelatedClassesProvider.kt:146-160 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaRelatedContext.kt:44-61 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/base/CodeProblemAnalysis.kt:30 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/chat/base/CodeProblemAnalysis.kt:30-44 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/devins/provider/psi/CodeSmellCollector.kt:18-36 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:40 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.jvm.kt:40-54 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgePageStateExtractor.kt:29-43 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaContextManager.kt:206 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaContextManager.kt:206-220 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:539-553 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/DataProps.kt:111 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/DataProps.kt:111-125 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/DataProps.kt:145-160 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:223 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:223-237 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:239-253 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:145 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.js.kt:145-159 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:222-236 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:35 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:35-49 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:54-68 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/stateful/StatefulNanoNodeDispatcher.kt:45 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/stateful/StatefulNanoNodeDispatcher.kt:45-61 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/render/stateful/StatefulNanoNodeDispatcher.kt:71-85 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:371 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:371-385 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/filesystem/ToolFileSystem.kt:239-254 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:104 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:104-118 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/NpmVersionProvider.kt:62-76 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/BuiltinCommandCompletionProvider.kt:48 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/BuiltinCommandCompletionProvider.kt:48-62 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/ToolBasedCommandCompletionProvider.kt:17-32 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×15
  • 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 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. 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/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 227 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:122 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileSystemTreeView.jvm.kt:122-130 | mpp-viewer/src/commonMain/kotlin/cc/unitmesh/viewer/LanguageDetector.kt:78-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:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • 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-core/src/commonMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundle.kt:134 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundle.kt:134-140 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundle.kt:141-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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/artifact/ArtifactBundle.kt:134` 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/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:562 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:562-568 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentViewModel.kt:411-417 — 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:562` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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.
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.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×13
  • Edited copy of a member (13 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt:188 — mpp-core/src/commonMain/kotlin/cc/unitmesh/config/ConfigFile.kt:188-200 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:734-748 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/IntentionsActionGroup.kt:17 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/IntentionsActionGroup.kt:17-29 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/intention/AutoDevIntentionsActionGroup.kt:15-27 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:77 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:77-89 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/MultimodalState.kt:69-84 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/compile/VariableTemplateCompiler.kt:119 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/compile/VariableTemplateCompiler.kt:119-131 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/ContextPrompter.kt:87-104 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:380 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:380-392 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:250-262 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:164 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:164-176 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:183-195 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:280 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:280-292 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:263-275 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:221 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:221-233 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:333-347 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:126 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:126-138 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:184-196 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditViewModel.kt:116 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditViewModel.kt:116-128 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:67-79 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/template/TemplateEngine.kt:35 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/template/TemplateEngine.kt:35-49 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/NanoBindingResolver.kt:129-141 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:288 — mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:288-301 | mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:256-268 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:378 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:378-390 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:793-809 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×13
  • Edited copy of a member (18 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:17 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:17-37 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinRefactoringTool.kt:20-37 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:508 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:508-526 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/FallbackNlpTokenizer.kt:528-545 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/BuiltinCommandCompletionProvider.kt:68 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/BuiltinCommandCompletionProvider.kt:68-88 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/FilePathCompletionProvider.kt:198-215 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:47 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:47-64 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:75-94 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:427 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:427-444 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:302-319 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:322 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:322-340 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:360-377 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/JewelMarkdownRenderer.kt:342 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/JewelMarkdownRenderer.kt:342-363 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/markdown/JewelMarkdownRenderer.kt:371-388 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:424 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:424-443 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageAttachmentPanel.kt:343-360 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:218 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:218-235 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:246-263 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/host/BuiltinMcpTools.kt:647 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/host/BuiltinMcpTools.kt:647-668 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/vcs/CommitInsCommand.kt:39-56 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/utils/ComposeSelectionCrashGuard.kt:18 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/utils/ComposeSelectionCrashGuard.kt:18-35 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/desktop/ComposeSelectionCrashGuard.kt:19-39 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:57 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/AbstractChatIntention.kt:57-74 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/base/ChatBaseIntention.kt:58-75 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/FrontMatterProcessor.kt:14 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/FrontMatterProcessor.kt:14-31 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/VelocityExpressionProcessor.kt:13-30 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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) · ×12
  • 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-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:100 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:100-139 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:121-183 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:188-250 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:232-275 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:404-447 — 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 (20 lines × 2) · ×12
  • 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 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. 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 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. 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/devins/document/docql/CodeDocQLExecutor.kt:130 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:130-149 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:197-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/document/docql/CodeDocQLExecutor.kt:130` it does not close everything it opens, so those 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-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 4 separate duplicated blocks between them, totalling at least 87 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/compose/agent/knowledge/DocQLDetailDialog.kt:273 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:273-292 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:313-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:273` 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/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:232 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:232-251 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/config/ToolConfigDialog.kt:566-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:232` it does not close everything it opens, so those 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 `null` to `modifier = Modifier.height(12.dp)) if (mcpLoadError !=` in one and `modifier = Modifier.height(8.dp)) if (errorMessage !=` 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 (20 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-320 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:370-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: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 (20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:129 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:129-148 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:336-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:129` 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 × 2) · ×12
  • 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 227 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-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-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/webedit/WebEditPage.kt:336 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:336-352 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:368-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/webedit/WebEditPage.kt:336` 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-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 (6 lines × 2) · ×12
  • 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/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:118 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:118-131 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:125-130 — before extracting anything, compare `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt` and `mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:118` 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 (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/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-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:197 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:197-202 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:295-300 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) 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/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:44 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:44-50 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/impl/MavenVersionProvider.kt:64-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/provider/impl/MavenVersionProvider.kt:44` it does not close everything it opens, so those 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 (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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×11
  • 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/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:94 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:94-114 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:119-139 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:79-104 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:58-76 — 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/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:22 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:22-107 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:112-177 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:18-74 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:76-125 — 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-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt:24 — mpp-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt:24-49 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptLivingDocumentation.kt:42-83 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:109-147 | mpp-idea/mpp-idea-lang/rust/src/main/kotlin/cc/unitmesh/rust/provider/RustLivingDocumentation.kt:26-61 — 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.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×11
  • Edited copy of a member (16 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:75 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/model/DomainDictionary.kt:75-90 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/model/DomainDictionary.kt:177-192 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:162 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:162-177 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:187-203 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:23 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/GradleBuildTool.kt:23-38 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/SpringGradleContextProvider.kt:143-158 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanLangSketch.kt:271 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/PlanLangSketch.kt:271-286 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaPlanActions.kt:70-90 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/model/LLMModelManager.kt:416 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/model/LLMModelManager.kt:416-431 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/model/LLMModelManager.kt:436-457 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:109 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:109-124 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:142-160 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:145 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:145-160 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/DataSourceRepository.kt:162-177 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt:57 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt:57-73 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/StatefulNanoRenderer.kt:90-105 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:29 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:29-44 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:149-170 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:97 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:97-112 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/filesystem/AndroidToolFileSystem.kt:114-129 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:59 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:59-74 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:39-57 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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 7 separate duplicated blocks between them, totalling at least 130 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 7 separate duplicated blocks between them, totalling at least 130 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/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 227 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 10 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. 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 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. 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.
  • Duplicated block (18 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:217 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:217-234 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/timeline/IdeaToolCallBubble.kt:284-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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:217` 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 (10 lines × 3) · ×11
  • 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-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:361 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:361-370 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:222-231 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:429-438 — 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.
  • Duplicated block (10 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:306 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:306-319 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlanPanel.kt:153-162 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:289-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 4 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:306` 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 × 3) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:143 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:143-152 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:139-148 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:327-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 8 separate duplicated blocks between them, totalling at least 172 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/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 8 separate duplicated blocks between them, totalling at least 172 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/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 6 separate duplicated blocks between them, totalling at least 81 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaCodeActions.kt:28 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaCodeActions.kt:28-37 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaDiagramActions.kt:21-30 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:112-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 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.
  • 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.
  • Duplicated block (10 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:102 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:102-113 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:151-160 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/DataSourceConfigPane.kt:187-196 — 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/chatdb/components/DataSourceConfigPane.kt:102` 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 · Edited copy of a member (12 corresponding lines) · ×10
  • Edited copy of a member (12 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/SchemaLinker.kt:45 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/SchemaLinker.kt:45-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/executor/SelfHealingLocator.kt:182-201 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:104 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:104-115 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:169-182 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:145 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/artifact/PythonArtifactPackager.kt:145-156 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:874-886 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/DomainDictGenerator.kt:241 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/DomainDictGenerator.kt:241-252 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/indexer/DomainDictGenerateAction.kt:228-239 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:265 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:265-276 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:170-182 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:170 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:170-181 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:207-220 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt:47 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt:47-58 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/PlanParser.kt:109-120 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:215 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:215-226 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListPanel.kt:179-191 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/planner/MarkdownLanguageField.kt:30 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/planner/MarkdownLanguageField.kt:30-45 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/provider/local/JsonTextProvider.kt:48-59 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:404 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:404-417 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/state/DesktopUiState.kt:47-58 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×10
  • Edited copy of a member (19 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:252 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:252-270 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDiffRenderer.kt:295-315 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/template/TemplateCompiler.kt:31 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/template/TemplateCompiler.kt:31-51 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/template/TemplateEngine.kt:12-30 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/context/JavaScriptMethodContextBuilder.kt:17 — mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/context/JavaScriptMethodContextBuilder.kt:17-35 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinMethodContextBuilder.kt:18-41 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:377 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:377-395 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:414-432 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:347 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:347-365 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:366-384 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:199 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:199-217 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/planner/TestActionPlanner.kt:345-367 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:235 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:235-258 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:254-272 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/DomainDictService.kt:193 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/DomainDictService.kt:193-211 | mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/PromptEnhancer.kt:113-135 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:212 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:212-233 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/demo/CodeReviewDemo.kt:186-204 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/LLMProvider2.kt:266 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/LLMProvider2.kt:266-288 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/LLMProvider2.kt:295-313 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×10
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/LineInfo.kt:30 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/LineInfo.kt:30-39 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/model/LineInfo.kt:19-28 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:64 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:64-73 | mpp-idea/mpp-idea-exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/ShellCommandSuggestAction.kt:53-63 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1240 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1240-1249 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1258-1269 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:219 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaDevInInput.kt:219-228 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:148-157 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:216 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/AutoDevInput.kt:216-225 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/ProjectFileUtil.kt:54-64 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/DirReferenceLanguageProvider.kt:32 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/DirReferenceLanguageProvider.kt:32-41 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/RuleCompletionProvider.kt:30-40 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:215 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:215-224 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/chat/ui/file/WorkspaceFileSearchPopup.kt:253-266 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:38 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:38-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/ShellBasedLinter.kt:29-39 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlFlow.kt:21 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlFlow.kt:21-30 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow/AutoPageFlow.kt:14-23 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/LLMMetadataReranker.kt:269 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/LLMMetadataReranker.kt:269-278 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/DomainDictGenerator.kt:45-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×10
  • Edited copy of a member (8 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/EditTool.kt:92 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/EditTool.kt:92-99 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/SmartEditTool.kt:88-98 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:23 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:23-30 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:28-35 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:343 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:343-350 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:470-477 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:161 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:161-169 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:678-685 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:70 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:70-79 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:75-82 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.android.kt:6 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.android.kt:6-13 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/MermaidHtml.jvm.kt:6-13 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectClient.kt:32 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectClient.kt:32-39 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:124-131 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:163 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:163-170 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:172-179 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectClient.kt:58 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectClient.kt:58-65 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionClient.kt:136-143 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/ParseCommentProcessor.kt:18 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/middleware/builtin/ParseCommentProcessor.kt:18-25 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaLivingDocumentation.kt:129-141 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
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: 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: 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: 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: 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: 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.
  • 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: 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×10
  • Swallowed exception (empty catch) mpp-vscode/webview/src/components/nano/NanoRenderer.tsx:67 — 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-vscode/src/providers/devins-completion.ts:58 — 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-vscode/src/actions/auto-actions.ts:139 — 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:166 — 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpConnectionProvider.jvm.kt:145 — 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpConnectionProvider.jvm.kt:150 — 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-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/acp/AcpConnectionProvider.jvm.kt:247 — 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-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:364 — 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-ui/src/jsMain/typescript/i18n/index.ts:41 — 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-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:505 — 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.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×9
  • Edited copy of a member (11 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaCodeBlockRenderer.kt:140 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaCodeBlockRenderer.kt:140-164 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaTerminalRenderer.kt:127-137 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:361 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:361-372 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:254-264 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:164 — mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:164-183 | mpp-idea/mpp-idea-lang/rust/src/main/kotlin/cc/unitmesh/rust/provider/RustLivingDocumentation.kt:77-87 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/DevinBlockParser.kt:86 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/DevinBlockParser.kt:86-98 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/ToolCallParser.kt:113-123 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeAction.kt:14 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeAction.kt:14-24 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/actions/completion/InlayCompleteCodeDisposedAction.kt:15-26 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlFlow.kt:32 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/flow/AutoSqlFlow.kt:32-42 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/flow/AutoPageFlow.kt:36-46 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/DirUtil.kt:8 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/DirUtil.kt:8-18 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/file/WriteInsCommand.kt:90-100 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.wasmJs.kt:15 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.wasmJs.kt:15-25 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.wasmJs.kt:27-38 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:42 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:42-53 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:70-80 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×9
  • Edited copy of a member (14 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:400 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:400-413 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:471-484 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:427 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:427-440 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:295-308 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:84 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:84-97 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:131-148 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:83 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:83-96 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/shell/BuiltinCommands.kt:106-119 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/HobbitHoleParser.kt:181 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/HobbitHoleParser.kt:181-195 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/HobbitHoleParser.kt:202-215 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/compose/FsRepository.kt:131 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/compose/FsRepository.kt:131-144 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/compose/FsRepository.kt:149-162 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:203 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:203-216 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:193-207 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:253 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:253-266 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:259-272 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:412 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:412-425 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:282-295 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×9
  • Edited copy of a member (9 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:33 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/NanoExpressionEvaluator.kt:33-41 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/state/NanoStateRuntime.kt:123-136 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/provider/DevInsPromptProcessor.kt:91 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/provider/DevInsPromptProcessor.kt:91-103 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/run/flow/DevInsProcessProcessor.kt:134-142 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:91 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/vcs/context/DiffFormatter.kt:91-99 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/vcs/context/DiffFormatter.kt:92-100 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DatabaseDriverFactory.kt:66 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/DatabaseDriverFactory.kt:66-76 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:279-287 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:63 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:63-71 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/variable/VariableTable.kt:37-45 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:202 — mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:202-210 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llm2/model/MessageConverter.kt:14-22 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JavaScriptTestCodeModifier.kt:46 — mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JavaScriptTestCodeModifier.kt:46-54 | mpp-idea/mpp-idea-lang/rust/src/main/kotlin/cc/unitmesh/rust/provider/RustCodeModifier.kt:47-55 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentDetailDialog.kt:30 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentDetailDialog.kt:30-38 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpConfigDialogWrapper.kt:58-71 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaPlanActions.kt:56 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaPlanActions.kt:56-65 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/desktop/TextContextMenu.kt:33-41 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×9
  • 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-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:89 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:89-107 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:116-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:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:190 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:190-208 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:353-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: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 (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/compose/editor/ModelConfigDialog.kt:233 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:233-251 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/ModelConfigDialog.kt:332-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/ModelConfigDialog.kt:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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 16 separate duplicated blocks between them, totalling at least 248 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 (5 lines × 2) · ×9
  • 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/toolwindow/knowledge/IdeaStructuredInfoPane.kt:60 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:60-64 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaStructuredInfoPane.kt:83-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: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 (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-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 10 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. 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 10 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. 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 16 separate duplicated blocks between them, totalling at least 248 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-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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×8
  • 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 4 separate duplicated blocks between them, totalling at least 87 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) 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 · Edited copy of a member (20 corresponding lines) · ×7
  • 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.
  • Edited copy of a member (20 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:171 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:171-190 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:192-211 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mpp-idea/mpp-idea-lang/pycharm/src/main/kotlin/cc/unitmesh/python/provider/PythonAutoTestService.kt:37 — mpp-idea/mpp-idea-lang/pycharm/src/main/kotlin/cc/unitmesh/python/provider/PythonAutoTestService.kt:37-56 | mpp-idea/mpp-idea-lang/pycharm/src/main/kotlin/cc/unitmesh/python/provider/PythonRunService.kt:22-47 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:355 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:355-376 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:336-355 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:18 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/variable/VariableTable.kt:18-37 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/ast/variable/VariableTable.kt:6-25 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:172 — mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:172-191 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:226-246 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:47 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:47-66 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:68-87 — 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 (22 corresponding lines) · ×7
  • Edited copy of a member (22 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:59 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:59-80 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/InputComponents.kt:83-105 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/BM25Scorer.kt:66 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/BM25Scorer.kt:66-87 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/scoring/BM25Scorer.kt:131-153 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:56 — xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:56-81 | xiuper-fs/src/commonMain/kotlin/cc/unitmesh/xiuper/fs/github/GitHubFsBackend.kt:112-133 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:181 — mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:181-204 | mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:433-454 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:91 — mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:91-114 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:225-246 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:376 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:376-404 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:407-428 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:454 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:454-478 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:235-256 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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 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. 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-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 8 separate duplicated blocks between them, totalling at least 172 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.
  • Duplicated block (14–15 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:89 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:89-102 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:143-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 10 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. 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 · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt:25 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt:25-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SwiftLintLinter.kt:25-56 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:101 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:101-119 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaPlanRenderer.kt:72-88 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:360 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:360-376 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:428-444 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/PrepushReviewAction.kt:52 — mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/PrepushReviewAction.kt:52-68 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/SwingFileSearchPopup.kt:143-163 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:105 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalState.kt:105-123 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/MultimodalState.kt:106-122 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:394 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:394-410 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:264-280 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×6
  • Edited copy of a member (28 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:180 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:180-210 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:213-240 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:174 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:174-201 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListCardPanel.kt:143-173 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:94 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:94-121 | mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:123-150 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:315 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:315-346 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:293-320 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt:121 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt:121-148 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/data/DataComponents.kt:333-362 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:559 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:559-586 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:698-725 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×6
  • Edited copy of a member (25 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:118 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:118-151 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:145-169 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/StructureDiagramBuilder.kt:211 — mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/StructureDiagramBuilder.kt:211-241 | mpp-idea/mpp-idea-exts/ext-git/src/main/kotlin/cc/unitmesh/git/actions/vcs/StructureDiagramBuilder.kt:247-271 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/IndexedDBStorage.kt:96 — mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/IndexedDBStorage.kt:96-120 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/platform/IndexedDBStorage.kt:125-156 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/UsedProcessor.kt:103 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/UsedProcessor.kt:103-127 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/UsedProcessor.kt:132-156 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:264 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:264-288 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:278-303 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:291 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentMessageList.kt:291-318 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactMessageList.kt:237-261 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:174 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:174-198 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:165-189 — 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 6 separate duplicated blocks between them, totalling at least 112 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:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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 (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 147 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 · Edited copy of a member (30 corresponding lines) · ×5
  • 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.
  • Edited copy of a member (30 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:75 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt:75-107 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteAgentClient.kt:54-83 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionRequest.kt:34 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/CodeCompletionRequest.kt:34-64 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/ShireCodeCompletionRequest.kt:37-66 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:58 — mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:58-89 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:194-223 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (30 corresponding lines) mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:64 — mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:64-93 | mpp-core/src/iosMain/kotlin/cc/unitmesh/config/ConfigManager.ios.kt:172-201 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×5
  • Edited copy of a member (6 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:109 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:109-114 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:148-153 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditModels.kt:34 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/webedit/IdeaWebEditModels.kt:34-39 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/DOMElement.kt:33-39 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/MermaidDiagramView.kt:106 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/MermaidDiagramView.kt:106-122 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaMermaidRenderer.kt:154-159 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/AgentCompletionProvider.kt:58 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/AgentCompletionProvider.kt:58-63 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/providers/VariableCompletionProvider.kt:9-17 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/ClassStructureVariableResolver.kt:9 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/ClassStructureVariableResolver.kt:9-14 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/custom/variable/MethodInputOutputVariableResolver.kt:9-14 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×5
  • 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:358 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:358-384 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt:904-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. 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:358` it does not close everything it opens, so those 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/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 (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 8 separate duplicated blocks between them, totalling at least 172 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.
  • Duplicated block (27 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:81 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:81-107 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:170-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:81` 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 lines × 2) · ×5
  • 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 7 separate duplicated blocks between them, totalling at least 130 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/base/ResizableSplitPane.kt:112 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:112-135 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:112-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:112` 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 (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 (23 lines × 2) · ×5
  • 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 79 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.
  • Duplicated block (23 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-45 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:24-46 — 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 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. 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.
  • Duplicated block (23 lines × 2) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:82 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.android.kt:82-104 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/parser/NanoDSLValidator.jvm.kt:84-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 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. 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 (23 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:161 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:161-183 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:228-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-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:161` 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/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:213 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:213-234 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:102-123 — 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 7 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/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:213` 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–17 lines × 2) · ×5
  • 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.
  • Duplicated block (16–17 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:88 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:88-104 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt:112-127 — 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 4 separate duplicated blocks between them, totalling at least 75 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:88` it does not close everything it opens, so those 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/session/CreateSessionDialog.kt:194 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:194-210 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:84-99 — 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 7 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/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.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×5
  • 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 334 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.
  • Duplicated block (15 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:224 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:224-238 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:356-370 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:207-221 — 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/session/CreateSessionDialog.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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: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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×5
  • 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 4 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-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.
  • Duplicated block (14 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.kt:78 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.kt:78-91 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:63-76 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:63-76 — 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 79 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/sketch/MermaidBlockRenderer.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 (14 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:167 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/CreateProjectDialog.kt:167-180 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/CreateSessionDialog.kt:269-282 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:158-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/session/CreateSessionDialog.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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:167` 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 (13 lines × 3) · ×5
  • 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-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 — 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. ★ 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 (11 lines × 5) · ×5
  • Duplicated block (11 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-37 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-36 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-36 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:27-37 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/CodeReviewAnalysisRepository.kt:26-36 — 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 106 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.
  • 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) · ×5
  • Duplicated block (9 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/DomainDictAgent.kt:520 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/DomainDictAgent.kt:520-528 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:401-409 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:472-480 — 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-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/DomainDictAgent.kt:520` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:472 — mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:472-480 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:505-513 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:551-559 — 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-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:472` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) 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.
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) REDACTED:113 — REDACTED:113 · REDACTED: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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×4
  • Edited copy of a member (45 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:51 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:51-95 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt:54-118 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:286 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:286-330 | mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:339-383 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:223 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:223-275 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaMultimodalService.kt:285-329 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:333 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:333-377 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt:389-439 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:135 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/CodingAgentExports.kt:135-161 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/config/ToolConfigExports.kt:112-134 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:85 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:85-107 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/command/dataprovider/ClaudeSkillCommand.kt:112-134 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:191 — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:191-213 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:236-259 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDevInBlockRenderer.kt:210 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDevInBlockRenderer.kt:210-232 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/DevInBlockRenderer.kt:131-155 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×4
  • Edited copy of a member (24 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:57 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:57-82 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:57-80 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:78 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:78-102 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:105-128 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:696 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:696-723 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLStatsSection.kt:299-322 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:51 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:51-74 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionViewModel.kt:79-102 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt:194 — mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.js.kt:194-214 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:295-315 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:21 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:21-41 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/InlayLayoutManager.kt:43-63 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:518 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:518-538 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:540-560 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/CodeFont.android.kt:13 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/CodeFont.android.kt:13-33 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/CodeFont.jvm.kt:12-32 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×4
  • Edited copy of a member (26 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:134 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:134-159 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:103-129 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:71 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/knowledge/IdeaKnowledgeViewModel.kt:71-96 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentReaderViewModel.kt:143-176 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:39 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:39-64 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:56-82 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/claudeskill/ClaudeSkillInsCommand.kt:44 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/claudeskill/ClaudeSkillInsCommand.kt:44-72 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/speckit/SpecKitInsCommand.kt:46-71 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×4
  • Edited copy of a member (7 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/KillProcessInsCommand.kt:53 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/KillProcessInsCommand.kt:53-59 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/process/WriteProcessInputInsCommand.kt:63-69 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevDependenciesLabelAction.kt:19 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevDependenciesLabelAction.kt:19-25 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/gui/snippet/AutoDevLanguageLabelAction.kt:23-30 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) 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 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/FileSearch.kt:193 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/completion/FileSearch.kt:193-199 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/filesystem/WasmJsToolFileSystem.kt:296-302 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×4
  • Edited copy of a member (4 corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.android.kt:20 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.android.kt:20-24 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/nano/NanoImageCache.jvm.kt:22-25 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:119 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/bridge/BridgeRunContext.kt:119-122 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/SketchRunContext.kt:195-198 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:106 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:106-109 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GrepTool.kt:144-147 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) example/custom_agent/server.py:264 — example/custom_agent/server.py:264-267 | example/custom_llm_server/openai_proxy.py:54-57 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · 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 (32 lines × 2) · ×4
  • 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 227 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 147 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 4 separate duplicated blocks between them, totalling at least 75 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.
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 6 separate duplicated blocks between them, totalling at least 250 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 16 separate duplicated blocks between them, totalling at least 248 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 334 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 (26 lines × 2) · ×4
  • 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-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 334 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 (18 lines × 3) · ×4
  • 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 227 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/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:158 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:158-175 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:231-248 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:370-387 — 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/chat/TopBarMenuMobile.kt:158` 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 (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 (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:157 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:157-168 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:177-188 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:207-218 — 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/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:157` 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 × 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/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:282 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuDesktop.kt:282-293 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:220-231 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:257-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:282` it does not close everything it opens, so those 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-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) · ×4
  • Duplicated block (11 lines × 3) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:103 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:103-113 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:116-126 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:135-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.
  • Duplicated block (11 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-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/GolangciLintLinter.kt:37-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PMDLinter.kt:46-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 47 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 (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 6 separate duplicated blocks between them, totalling at least 72 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 (10 lines × 5) · ×4
  • 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.
  • Duplicated block (10 lines × 5) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:238 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:238-247 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:282-291 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:327-336 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:444-453 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:641-650 — 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/agent/chatdb/components/ChatDBStepCard.kt:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×4
  • Duplicated block (10 lines × 4) 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/PMDLinter.kt:47-56 | 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 47 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 × 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 8 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. 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 (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 6 separate duplicated blocks between them, totalling at least 72 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 106 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 (8 lines × 3) · ×4
  • 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.
  • Duplicated block (8 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:196 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:196-203 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:212-219 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:301-308 — 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/chatdb/components/ChatDBStepCard.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 (8 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:432 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:432-439 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:441-448 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:450-457 — 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/toolwindow/acp/IdeaAcpAgentContent.kt:432` 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 × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ActionlintLinter.kt:27 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ActionlintLinter.kt:27-34 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt:26-33 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/MarkdownlintLinter.kt:27-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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/linter/linters/ActionlintLinter.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.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×4
  • JavaScript dependencies are not locked mpp-ui/package.json:57 — mpp-ui/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked mpp-vscode/package.json:243 — mpp-vscode/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked mpp-vscode/webview/package.json:11 — mpp-vscode/webview/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked mpp-web/package.json:17 — mpp-web/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×4
  • 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`).
  • 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-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`).
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 · Edited copy of a member (50 corresponding lines) · ×3
  • Edited copy of a member (50 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:309 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaTopToolbar.kt:309-358 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileChip.kt:115-173 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:31 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/webedit/WebEditPreview.kt:31-107 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/e2etest/E2ETestAgentDemo.kt:43-92 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (50 corresponding lines) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:16 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.js.kt:16-65 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/FileViewerPanelWrapper.wasmJs.kt:16-65 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×3
  • Edited copy of a member (47 corresponding lines) mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:213 — mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.jvm.kt:213-278 | mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.wasmJs.kt:199-245 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:186 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:186-232 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/knowledge/DocQLDetailDialog.kt:349-409 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (47 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:248 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/context/FileSearchPopup.kt:248-294 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/omnibar/Omnibar.kt:193-240 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×3
  • Edited copy of a member (35 corresponding lines) mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:20 — mpp-server/src/main/kotlin/cc/unitmesh/server/config/ServerConfigLoader.kt:20-72 | xiuper-ui/src/jvmMain/kotlin/cc/unitmesh/xuiper/config/ConfigLoader.kt:20-54 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:72 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:72-106 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:39-80 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:374 — mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:374-415 | mpp-core/src/commonMain/kotlin/cc/unitmesh/llm/ModelRegistry.kt:494-528 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×3
  • Edited copy of a member (44 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:117 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/terminal/IdeaAnsiTerminalRenderer.kt:117-162 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/terminal/TerminalRenderer.kt:91-134 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:192 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:192-235 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:181-224 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:220 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:220-263 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:188-233 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×3
  • Edited copy of a member (42 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:239 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:239-280 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:283-324 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:309 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:309-353 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:356-397 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (42 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:637 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:637-678 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:794-835 — These two members are one piece of code written twice and then edited apart: 42 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 (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:36 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpFileEditorWithPreview.kt:36-72 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShireFileEditorWithPreview.kt:63-98 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:827 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:827-862 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/lexer/DevInsLexer.kt:868-908 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:758 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:758-793 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentViewModel.kt:648-683 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×3
  • Edited copy of a member (32 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:28 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:28-59 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt:28-59 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:40 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:40-71 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/actions/IdeaTerminalActions.kt:76-107 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:760 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/codereview/IdeaCodeReviewViewModel.kt:760-791 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:1222-1256 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×3
  • Edited copy of a member (31 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:499 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentContent.kt:499-529 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentContent.kt:295-329 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:58 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:58-88 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/command/ClaudeSkillCommand.kt:93-128 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:276 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:276-310 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:261-291 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×3
  • Edited copy of a member (27 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:136 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:136-162 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:79-107 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:427 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:427-453 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:420-453 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:763 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:763-789 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewViewModel.kt:794-821 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 11+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:48 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:48-58 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:61-73 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:67-83 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:89-108 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:186 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:186-196 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:332-345 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:347-357 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:568-587 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 11+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:87 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:87-98 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:115-126 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:294-309 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:431-441 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 16+ corresponding lines) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateEntityAction.kt:30 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateEntityAction.kt:30-45 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateFunctionAction.kt:30-48 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/actions/GenerateUnittestAction.kt:30-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:138 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:138-153 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:624-639 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:687-702 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:145 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.kt:145-160 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:329-346 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/PtyShellExecutor.kt:184-200 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 14+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:100 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:100-113 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:626-647 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:649-666 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:198 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:198-211 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:493-506 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:589-603 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:63 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:63-76 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.ios.kt:65-78 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/db/ModelConfigRepository.kt:63-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 8+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:480 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:480-506 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/app/UnifiedApp.kt:573-599 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/PlanPanel.kt:128-135 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/EscapeSequenceProcessor.kt:35 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/parser/EscapeSequenceProcessor.kt:35-43 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaDevInBlockRenderer.kt:237-244 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/AccessibilityTree.kt:284-291 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:276 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:276-283 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:579-590 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:142-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 18+ corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:228 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:228-245 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:247-264 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListPanel.kt:193-210 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:28 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:28-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/DevInsCompilerFacade.kt:56-78 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/service/DefaultDevInsCompilerService.kt:36-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:757 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:757-774 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/InlineIssueChip.kt:445-464 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditChatInput.kt:300-320 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 10+ corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpEditorProvider.kt:16 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/editor/McpEditorProvider.kt:16-25 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/debugger/editor/ShireSplitEditorProvider.kt:20-29 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/NanoDSLComposeSplitEditorProvider.kt:29-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:92 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:92-103 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:521-530 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:59-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/lang/VariableCompletionProvider.kt:17 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/lang/VariableCompletionProvider.kt:17-28 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/lang/WhenConditionCompletionProvider.kt:18-31 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/completion/provider/VariableCompletionProvider.kt:16-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · 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 7 separate duplicated blocks between them, totalling at least 130 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 227 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/SessionDetailScreen.kt:68 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:68-96 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:77-105 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt` as WHOLE FILES: this scan already matched 3 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. 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:68` 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–26 lines × 2) · ×3
  • 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 47 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-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:276 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:276-300 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:405-430 — both copies are in the same file, so extract the 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 (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 (21–22 lines × 2) · ×3
  • 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 — before extracting anything, compare `mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt` and `mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (21–22 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-88 | mpp-ui/src/appleMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.apple.kt:62-82 — 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 8 separate duplicated blocks between them, totalling at least 172 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 (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 (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 (19 lines × 3) · ×3
  • 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.
  • Duplicated block (19 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:361 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:361-379 | 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 — 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:361` it does not close everything it opens, so those 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 × 3) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:73 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:73-91 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:211-229 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:133-151 — 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 16 separate duplicated blocks between them, totalling at least 248 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:73` it does not close everything it opens, so those 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) · ×3
  • 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.
  • Duplicated block (18–19 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:242 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:242-260 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:268-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:242` it does not close everything it opens, so those 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 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 40 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 223 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 223 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 (17 lines × 3) · ×3
  • 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-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-367 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:380-396 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/StructuredInfoPane.kt:409-425 — 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.
  • 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 (16 lines × 3) · ×3
  • Duplicated block (16 lines × 3) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:166 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/CodeGraphClusterer.kt:166-181 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:136-151 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:294-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 (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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • 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/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.
  • Duplicated block (15–16 lines × 2) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:119 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:119-134 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt:71-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. ★ 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 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 (13–14 lines × 2) · ×3
  • 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.
  • Duplicated block (13–14 lines × 2) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:162 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/DevInsRunFileAction.kt:162-174 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/service/DevInRunService.kt:57-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 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-47 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:152-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: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.
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 6 separate duplicated blocks between them, totalling at least 72 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 · Low contrast colour pair in CSS (2.8 · ×2
  • 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.
  • Low contrast colour pair in CSS (2.8:1) mpp-vscode/webview/src/components/sketch/DiffRenderer.css:119 — `.diff-applied-overlay` 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 · ×2
  • Low contrast colour pair in CSS (3.7:1) mpp-vscode/webview/src/components/sketch/DiffRenderer.css:62 — `.diff-action-btn.reject` 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.
  • 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.
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 · DiffFormatter.postProcess (cognitive 23) · ×2
  • 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.
  • 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.
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 · CodeFence.parseMarkdownContent (cognitive 19) · ×2
  • 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.
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (80 shared lines) · ×2
  • Near-duplicate member pair (80 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: 80 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 (80 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: 80 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 (56 shared lines) · ×2
  • Near-duplicate member pair (56 shared lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:34 — 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 — These two members are variants of one another: 56 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 (56 shared lines) mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:20 — mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.js.kt:20-84 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.js.kt:21-85 — These two members are variants of one another: 56 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) · ×2
  • 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.
  • Edited copy of a member (48 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:59 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:59-107 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/ProcessManagementTools.kt:170-217 — 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 · 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 · Edited copy of a member (76 corresponding lines) · ×2
  • Edited copy of a member (76 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:46 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentCardPanel.kt:46-142 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListCardPanel.kt:39-114 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (76 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:111 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:111-189 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:103-178 — These two members are one piece of code written twice and then edited apart: 76 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 (70 corresponding lines) · ×2
  • Edited copy of a member (70 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:202 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:202-271 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:150-222 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (70 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:62 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:62-131 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:54-130 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×2
  • Edited copy of a member (58 corresponding lines) mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:75 — mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/terminal/AutoDevTerminalAction.kt:75-133 | mpp-idea/mpp-idea-exts/ext-terminal/src/main/kotlin/cc/unitmesh/terminal/ShellCommandSuggestAction.kt:68-125 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (58 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/BaseCompletionTask.kt:34 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/intentions/action/task/BaseCompletionTask.kt:34-91 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/task/ChatCompletionTask.kt:30-100 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×2
  • Edited copy of a member (56 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:21 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/LinterSummary.kt:21-92 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/linter/LinterExports.kt:143-198 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (56 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:295 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:295-352 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:278-333 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×2
  • Edited copy of a member (53 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:527 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:527-587 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactPreviewPanel.jvm.kt:596-648 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (53 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:73 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:73-127 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/artifact/ArtifactAgentViewModel.kt:135-187 — These two members are one piece of code written twice and then edited apart: 53 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 (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:376 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt:376-422 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:503-541 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt:20 — mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/context/KotlinVariableContextBuilder.kt:20-58 | mpp-idea/mpp-idea-lang/pycharm/src/main/kotlin/cc/unitmesh/python/context/PythonVariableContextBuilder.kt:22-68 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×2
  • Edited copy of a member (38 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:75 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:75-112 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:93-139 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) REDACTED:46 — REDACTED:46-87 | REDACTED:96-133 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:49 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/AILinter.kt:49-92 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/ShellBasedLinter.kt:41-83 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (43 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:271 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:271-315 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:356-398 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:41 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:41-69 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:53-81 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:60 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/inlay/ComponentInlaysContainer.kt:60-88 | mpp-idea/mpp-idea-exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/actions/input/inlay/ComponentInlaysContainer.kt:61-89 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 23+ corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:105 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaRefactoringTool.kt:105-127 | mpp-idea/mpp-idea-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/TypeScriptRefactoringTool.kt:111-135 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinRefactoringTool.kt:95-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 23+ corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:89 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:89-123 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:125-147 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:248-271 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:160 — mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/GitCoChangeClusterer.kt:160-193 | mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:331-370 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:212 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:212-245 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/llms/LLMProviderAdapter.kt:254-298 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:86 — mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:86-105 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteCheckpointManager.kt:107-128 | mpp-server/src/main/kotlin/cc/unitmesh/server/workflow/store/SqliteEventStore.kt:147-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:164 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:164-183 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitHubPRReviewService.kt:185-204 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/review/GitLabPRReviewService.kt:213-232 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 20+ corresponding lines) mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:45 — mpp-codegraph/src/iosMain/kotlin/cc/unitmesh/codegraph/parser/ios/IosCodeParser.kt:45-64 | mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:108-131 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:535-556 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:75-99 | mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:50-69 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 20+ corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:584 — mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:584-603 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:609-628 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:634-653 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:666-688 | mpp-core/src/jsMain/kotlin/cc/unitmesh/llm/JsExports.kt:698-717 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 20+ corresponding lines) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:215 — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:215-234 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:261-280 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:383-409 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:536-555 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 20+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:121 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:121-140 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:145-165 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:40-60 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:66-87 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 9+ corresponding lines) mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:28 — mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:28-38 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:87-95 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:129-137 | mpp-viewer-web/src/commonMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridgeAdapter.kt:139-147 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 9+ corresponding lines) mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.android.kt:36 — mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.android.kt:36-44 | mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.ios.kt:40-48 | mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.js.kt:37-45 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.wasmJs.kt:39-47 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 8+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/InputProps.kt:22 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/InputProps.kt:22-29 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/InputProps.kt:45-52 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/InputProps.kt:109-117 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/props/InputProps.kt:134-142 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:213 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:213-222 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/NanoDSLAgent.kt:419-426 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:309-318 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/SqlReviseAgent.kt:248-257 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (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 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. 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 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. 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 (40 lines × 2) · ×2
  • Duplicated block (40 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-280 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/CreateTaskDialog.kt:130-169 — 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 7 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/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.
  • 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 (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 (34–35 lines × 2) · ×2
  • Duplicated block (34–35 lines × 2) REDACTED:53 — REDACTED:53-87 | REDACTED:100-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:53` 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–35 lines × 2) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1609 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1609-1643 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1692-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.
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 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. 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 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. 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 8 separate duplicated blocks between them, totalling at least 172 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/session/CreateSessionDialog.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 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 3 separate duplicated blocks between them, totalling at least 57 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–23 lines × 2) · ×2
  • Duplicated block (20–23 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:361 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:361-380 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:392-414 — both copies are in the same file, so extract the 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 (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) · ×2
  • Duplicated block (22–23 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:751 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:751-772 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:833-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:751` 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/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 (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 (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 7 separate duplicated blocks between them, totalling at least 130 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 (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 (15–19 lines × 2) · ×2
  • Duplicated block (15–19 lines × 2) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:145 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:145-159 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.kt:329-347 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/AutoDevApp.android.kt:145` 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–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 (17–18 lines × 3) · ×2
  • 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.
  • Duplicated block (17–18 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:754 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:754-771 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:816-832 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:837-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:754` 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 (17–18 lines × 2) · ×2
  • 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.
  • Duplicated block (17–18 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:219 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:219-235 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenuMobile.kt:255-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:219` it does not close everything it opens, so those 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–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 (14–16 lines × 4) · ×2
  • 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.
  • Duplicated block (14–16 lines × 4) mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:96 — mpp-core/src/androidMain/kotlin/cc/unitmesh/config/ConfigManager.android.kt:96-111 | mpp-core/src/jsMain/kotlin/cc/unitmesh/config/ConfigManager.js.kt:121-136 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/config/ConfigManager.jvm.kt:84-99 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/config/ConfigManager.wasmJs.kt:60-73 — 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 6 separate duplicated blocks between them, totalling at least 81 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) · ×2
  • 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 106 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.
  • Duplicated block (15 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-137 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:94-108 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:85-99 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:223-237 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:145-159 — 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 6 separate duplicated blocks between them, totalling at least 72 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:123` it does not close everything it opens, so those 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–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 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. 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 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. 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 10 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/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 (12 lines × 4) · ×2
  • 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.
  • Duplicated block (12 lines × 4) mpp-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt:38 — mpp-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt:38-49 | 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/mpp-idea-lang/goland/src/main/kotlin/cc/unitmesh/go/provider/GoLivingDocumentationProvider.kt:38` 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:23 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:23-34 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/util/parser/CodeFence.kt:19-29 — 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 7 separate duplicated blocks between them, totalling at least 130 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: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.
  • 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 (10–12 lines × 2) · ×2
  • 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.
  • Duplicated block (10–12 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-115 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:171-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 10 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/renderer/sketch/chart/IdeaChartParser.kt:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:39 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ESLintLinter.kt:39-47 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/HadolintLinter.kt:36-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SwiftLintLinter.kt:36-44 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/YamllintLinter.kt:39-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 40 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: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.
  • 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 6 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×2
  • Duplicated block (7 lines × 6) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:30 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:30-36 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:45-51 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:60-66 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/parser/CodeFence.kt:147-153 | 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 — 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 7 separate duplicated blocks between them, totalling at least 130 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 × 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.
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.
R8 · Dependency Hygiene · Unused dependency '@modelcontextprotocol/sdk' · ×2
  • 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.
  • Unused dependency '@modelcontextprotocol/sdk' — Declared in mpp-vscode/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.
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 })`.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.1 · ×1
  • Low contrast colour pair in CSS (3.1:1) mpp-viewer-web/src/jvmMain/resources/test-shadow-dom.html:28 — `button` sets color: white on background-color: #2196F3 — 3.1: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 (4.0 · ×1
  • Low contrast colour pair (4.0:1) mpp-web/src/App.tsx:293 — The inline foreground/background colours fall below the 4.5:1 WCAG AA minimum for normal text. Darken/lighten one of them.
C1 · Data Protection · No data-protection/encryption · ×1
  • No data-protection/encryption mpp-ui/src/commonMain/sqldelight/cc/unitmesh/devins/db/DataSource.sq:9 — 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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) REDACTED: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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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) REDACTED: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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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 · 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×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, 26 shared lines) · ×1
  • Near-duplicate member family (5 members, 26 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 26 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, 57 shared lines) · ×1
  • Near-duplicate member family (3 members, 57 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 57 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 (146 shared lines) · ×1
  • Near-duplicate member pair (146 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: 146 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 (89 shared lines) · ×1
  • Near-duplicate member pair (89 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: 89 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 (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:29 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:29-153 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:29-174 — These two members are variants of one another: 62 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 (61 shared lines) · ×1
  • Near-duplicate member pair (61 shared lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:28 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/project/ProjectListScreen.kt:28-145 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskListScreen.kt:31-167 — These two members are variants of one another: 61 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 (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:201 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:201-330 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/dialog/LLMDialog.kt:332-447 — These two members are variants of one another: 46 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 · 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 (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 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/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:274-289 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.kt:44-106 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:194-209 | 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:194-209 | 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/chart/ChartBlockRenderer.wasmJs.kt:194-209 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:26-81 — These 9 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 9 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 9 times.
D4 · Code Duplication · Edited copy of a member (134 corresponding lines) · ×1
  • Edited copy of a member (134 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:483 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffCenterView.kt:483-619 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/diff/DiffFileTreeView.kt:365-498 — These two members are one piece of code written twice and then edited apart: 134 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 (85 corresponding lines) · ×1
  • Edited copy of a member (85 corresponding lines) 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-101 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/runconfig/ProcessOutputReader.jvm.kt:12-96 — These two members are one piece of code written twice and then edited apart: 85 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 (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:805 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:805-887 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBStepCard.kt:896-981 — These two members are one piece of code written twice and then edited apart: 83 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 (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:499 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:499-579 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:585-663 — These two members are one piece of code written twice and then edited apart: 79 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 (80 corresponding lines) · ×1
  • Edited copy of a member (80 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:183 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:183-267 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:176-255 — These two members are one piece of code written twice and then edited apart: 80 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 (89 corresponding lines) · ×1
  • Edited copy of a member (89 corresponding lines) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:88 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/database/ExposedDatabaseConnection.kt:88-181 | mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/connection/IdeaDatabaseConnection.kt:86-174 — These two members are one piece of code written twice and then edited apart: 89 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaThinkingBlockRenderer.kt:30 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/IdeaThinkingBlockRenderer.kt:30-111 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/ThinkingBlockRenderer.kt:29-118 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (91 corresponding lines) · ×1
  • Edited copy of a member (91 corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:53 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/ChartAgent.kt:53-143 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/subagent/PlotDSLAgent.kt:64-175 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:199 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentViewModel.kt:199-258 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/remote/RemoteCodingAgentViewModel.kt:183-254 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 54+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 54+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt:27 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.android.kt:27-80 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.js.kt:27-80 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.wasmJs.kt:27-80 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 54 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:28 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.android.kt:28-90 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.ios.kt:28-90 — These two members are one piece of code written twice and then edited apart: 63 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 (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:33 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:33-107 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploader.jvm.kt:114-196 — These two members are one piece of code written twice and then edited apart: 75 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 (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageGenerationModelSelector.kt:44 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageGenerationModelSelector.kt:44-118 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/VisionModelSelector.kt:23-95 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:232 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:232-274 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeSummary.kt:246-286 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) 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-76 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/DefaultShellExecutor.jvm.kt:45-104 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 42+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 42+ corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:71 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:71-112 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaCustomDevInsSymbolProvider.kt:115-156 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaSymbolProvider.kt:86-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:293 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:293-335 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:707-753 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:159-198 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:163 — mpp-core/src/jsMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:163-210 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/devins/document/CodeDocumentParser.kt:163-208 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt:32 — mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaTestContextProvider.kt:32-80 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinTestContextProvider.kt:25-76 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:379 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/plan/IdeaPlanSummaryBar.kt:379-415 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/plan/PlanSummaryBar.kt:358-394 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:45 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:45-111 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/mcp/ui/McpToolListPanel.kt:38-94 — These two members are one piece of code written twice and then edited apart: 57 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 (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:171 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/JewelSelectionRenderer.kt:171-203 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/nano/components/input/SelectionComponents.kt:110-149 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:474 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:474-524 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/NanoDSLBlockRenderer.kt:547-597 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 52+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 52+ corresponding lines) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:115 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.android.kt:115-166 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.ios.kt:116-167 | mpp-ui/src/jsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MarkdownSketchRenderer.js.kt:121-172 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 52 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:68 — mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:68-102 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:113-147 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:431-475 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 29+ corresponding lines) mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:438 — mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:438-485 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:490-518 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:523-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ActionlintLinter.kt:26 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/ActionlintLinter.kt:26-59 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/DotenvLinter.kt:25-56 | mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/PylintLinter.kt:25-57 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:474 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:474-491 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:537-553 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/ir/NanoIRConverter.kt:605-622 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:344 — mpp-codegraph/src/jsMain/kotlin/cc/unitmesh/codegraph/parser/js/JsCodeParser.kt:344-376 | mpp-codegraph/src/jvmMain/kotlin/cc/unitmesh/codegraph/parser/jvm/JvmCodeParser.kt:762-791 | mpp-codegraph/src/wasmJsMain/kotlin/cc/unitmesh/codegraph/parser/wasm/WasmJsCodeParser.kt:207-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:66 — mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/DefaultCodingAgentRenderer.kt:66-104 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:230-269 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/DocumentCli.kt:565-597 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 24+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:327 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:327-350 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/multimodal/IdeaImageUploadManager.kt:355-378 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:93-121 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/multimodal/ImageUploadManager.kt:220-248 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:335 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:335-361 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:364-390 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/document/DocumentNavigationPane.kt:393-419 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 12+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:117 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:117-128 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:130-141 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:184-200 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:202-218 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:220-236 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:238-254 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1118 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1118-1137 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1177-1191 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:1196-1207 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/SimplifiedLLMSettingComponent.kt:309 — mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/SimplifiedLLMSettingComponent.kt:309-323 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/ui/FormBuilderExtensions.kt:12-26 | mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/settings/ui/LLMUIComponents.kt:12-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:169 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:169-181 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:186-198 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/acp/IdeaAcpAgentViewModel.kt:203-216 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 27+ corresponding lines) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:22 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:22-53 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:60-86 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:93-128 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:135-163 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/TerminalPreview.kt:199-228 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:414 — mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:414-427 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:432-445 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:450-462 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:467-479 | mpp-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitOperations.wasmJs.kt:557-569 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/provider/SqlLivingDocumentationProvider.kt:39 — mpp-idea/mpp-idea-exts/ext-database/src/main/kotlin/cc/unitmesh/database/provider/SqlLivingDocumentationProvider.kt:39-48 | mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaLivingDocumentation.kt:72-82 | mpp-idea/mpp-idea-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:194-204 | mpp-idea/mpp-idea-lang/rust/src/main/kotlin/cc/unitmesh/rust/provider/RustLivingDocumentation.kt:63-72 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:63 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.android.kt:63-74 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.ios.kt:63-74 | mpp-viewer-web/src/wasmJsMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditBridge.wasmJs.kt:63-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelButtonComponents.kt:28 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelButtonComponents.kt:28-31 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelContentComponents.kt:30-33 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelFeedbackComponents.kt:30-33 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelInputComponents.kt:33-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (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 6 separate duplicated blocks between them, totalling at least 250 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 334 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 334 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 (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:298 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:298-365 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:519-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. ★ 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/agent/CodingAgentPage.kt:295` calls `when` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/CodingAgentPage.kt:517` 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 (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 × 3) · ×1
  • Duplicated block (49 lines × 3) mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:198 — mpp-viewer-web/src/androidMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:198-246 | mpp-viewer-web/src/iosMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:198-246 | mpp-viewer-web/src/jvmMain/kotlin/cc/unitmesh/viewer/web/webedit/WebEditView.jvm.kt:192-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 334 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:198` 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 (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 227 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 (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 8 separate duplicated blocks between them, totalling at least 172 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 (34–36 lines × 2) · ×1
  • Duplicated block (34–36 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:318 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:318-353 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:364-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaFileSearchPopup.kt:318` 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 (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 16 separate duplicated blocks between them, totalling at least 248 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 6 separate duplicated blocks between them, totalling at least 250 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 223 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 147 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 4 separate duplicated blocks between them, totalling at least 87 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 (29–32 lines × 4) · ×1
  • Duplicated block (29–32 lines × 4) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:47 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaResizableSplitPane.kt:47-75 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/components/IdeaVerticalResizableSplitPane.kt:47-75 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/ResizableSplitPane.kt:55-86 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/base/VerticalResizableSplitPane.kt:55-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 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. 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:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
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 106 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 (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewPage.kt:108 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewPage.kt:108-138 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewSideBySideView.kt:75-103 — 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/CodeReviewPage.kt:108` 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 (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 (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 (19–27 lines × 2) · ×1
  • Duplicated block (19–27 lines × 2) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:339 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:339-365 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/agent/LiveTerminalItem.jvm.kt:596-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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:339` it does not close everything it opens, so those 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 334 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 106 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 (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 223 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–23 lines × 3) · ×1
  • Duplicated block (22–23 lines × 3) xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:387 — xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:387-408 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:783-804 | xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:820-842 — 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 `xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/parser/IndentParser.kt:783` 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 (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 223 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 (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:126 — mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ArtifactCli.kt:126-145 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ChatDBCli.kt:97-116 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/CodingCli.kt:88-107 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt:148-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 6 separate duplicated blocks between them, totalling at least 72 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:126` 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 (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 6 separate duplicated blocks between them, totalling at least 81 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 (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 (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:100 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt:100-116 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt:110-129 — before extracting anything, compare `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/session/SessionDetailScreen.kt` and `mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/task/TaskExecutionScreen.kt` as WHOLE FILES: this scan already matched 3 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. 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:100` 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 × 4) · ×1
  • Duplicated block (19 lines × 4) 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-52 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/CodeReviewAgentPanel.kt:332-350 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/ModificationPlanSection.kt:100-118 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/codereview/SuggestedFixesAgentView.kt:42-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 3 separate duplicated blocks between them, totalling at least 57 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.
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 (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 (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 223 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–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt:177 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/AgentInterfaceRouter.kt:177-193 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenu.kt:50-65 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/chat/TopBarMenu.kt:76-92 — 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/AgentInterfaceRouter.kt:177` 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 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 106 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 (15–16 lines × 5) · ×1
  • Duplicated block (15–16 lines × 5) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:107 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.kt:107-122 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:130-144 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/CodeDocQLExecutor.kt:197-211 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:246-260 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/MarkdownDocQLExecutor.kt:418-432 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/document/docql/BaseDocQLExecutor.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.
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 (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 223 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 (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 (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 × 4) · ×1
  • 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.
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 10 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/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 (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 10 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/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 (13 lines × 9) · ×1
  • Duplicated block (13 lines × 9) mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:197 — mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.android.kt:197-209 | mpp-ui/src/androidMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.android.kt:277-289 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/MermaidBlockRenderer.kt:83-95 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.ios.kt:197-209 | mpp-ui/src/iosMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.ios.kt:68-80 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.jvm.kt:197-209 | mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.jvm.kt:284-296 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartBlockRenderer.wasmJs.kt:197-209 | mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/letsplot/LetsPlotBlockRenderer.wasmJs.kt:68-80 — 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 223 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:197` 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 (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 223 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 6 separate duplicated blocks between them, totalling at least 81 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 10 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/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 (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:532 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:532-544 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:608-618 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/IdeaAgentViewModel.kt:532` it does not close everything it opens, so those 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/IdeaAgentViewModel.kt:528` calls `clearError`, `addUserMessage` and `mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentViewModel.kt:607` 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 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 (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 6 separate duplicated blocks between them, totalling at least 72 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 (6–10 lines × 2) · ×1
  • Duplicated block (6–10 lines × 2) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:297 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/WebEditPage.kt:297-302 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/editor/DevInEditorInput.kt:220-229 — 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/webedit/WebEditPage.kt:297` it does not close everything it opens, so those 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 (9–10 lines × 2) · ×1
  • 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–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:104 — mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:104-112 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:129-136 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/webedit/automation/WebEditAutomation.kt:156-163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:149 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartParser.kt:149-155 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:223-230 | mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/sketch/chart/ChartParser.kt:241-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 10 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/renderer/sketch/chart/IdeaChartParser.kt:149` 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 (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:137 — mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:137-142 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:183-188 | mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/sketch/chart/IdeaChartRenderer.kt:216-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: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `data` to `ChartDataContent.LineData` in one and `ChartDataContent.ColumnData` 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 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 (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 (52 lines × 2) · ×1
  • 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 (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 6 separate duplicated blocks between them, totalling at least 81 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 (5 lines × 3) · ×1
  • 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.
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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/AgentProcessor.kt:14 — mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/AgentProcessor.kt:14-27 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/CommandProcessor.kt:15-28 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/UsedProcessor.kt:20-33 | mpp-core/src/commonMain/kotlin/cc/unitmesh/devins/compiler/processor/VariableProcessor.kt:16-29 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:98 — mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:98-108 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:158-168 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:178-188 | mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:208-218 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/platform/GitOperations.jvm.kt:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 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.
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 (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:65 — mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:65 · mpp-vscode/webview/src/components/plan/PlanSummaryBar.tsx:213 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
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.
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.
R2 · Cyclomatic Complexity · Complex function handleDeepResearchCommand (cyclomatic 19, cognitive 21) · ×1
  • Complex function handleDeepResearchCommand (cyclomatic 19, cognitive 21) mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:374 — handleDeepResearchCommand has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function splitTopLevelDeclarators (cyclomatic 18, cognitive 25) · ×1
  • Complex function splitTopLevelDeclarators (cyclomatic 18, cognitive 25) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1929 — splitTopLevelDeclarators has cyclomatic complexity 18 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runServerAgent (cyclomatic 18, cognitive 24) · ×1
  • Complex function runServerAgent (cyclomatic 18, cognitive 24) mpp-ui/src/jsMain/typescript/index.tsx:249 — runServerAgent has cyclomatic complexity 18 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 readVariableDeclaratorPattern (cyclomatic 17, cognitive 24) · ×1
  • Complex function readVariableDeclaratorPattern (cyclomatic 17, cognitive 24) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1807 — readVariableDeclaratorPattern has cyclomatic complexity 17 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 findTopLevelCharacter (cyclomatic 17, cognitive 24) · ×1
  • Complex function findTopLevelCharacter (cyclomatic 17, cognitive 24) mpp-ui/src/jsMain/typescript/node-repl/NodeReplRuntime.ts:1888 — findTopLevelCharacter has cyclomatic complexity 17 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 handleInput (cyclomatic 17, cognitive 23) · ×1
  • Complex function handleInput (cyclomatic 17, cognitive 23) mpp-ui/src/jsMain/typescript/modes/ChatMode.ts:69 — handleInput has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateTestReport (cyclomatic 17, cognitive 16) · ×1
  • Complex function generateTestReport (cyclomatic 17, cognitive 16) mpp-ui/src/test/framework/reporters/ConsoleReporter.ts:15 — generateTestReport has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleInput (cyclomatic 17, cognitive 15) · ×1
  • Complex function handleInput (cyclomatic 17, cognitive 15) mpp-ui/src/jsMain/typescript/modes/AgentMode.ts:127 — handleInput has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ChatInput (cyclomatic 17, cognitive 14) · ×1
  • Complex function ChatInput (cyclomatic 17, cognitive 14) mpp-vscode/webview/src/components/ChatInput.tsx:32 — ChatInput has cyclomatic complexity 17 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 formatToolParams (cyclomatic 17, cognitive 10) · ×1
  • Complex function formatToolParams (cyclomatic 17, cognitive 10) mpp-ui/src/jsMain/typescript/agents/render/TuiRenderer.ts:206 — formatToolParams has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseMarkdownFindings (cyclomatic 16, cognitive 36) · ×1
  • Complex function parseMarkdownFindings (cyclomatic 16, cognitive 36) mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:323 — parseMarkdownFindings has cyclomatic complexity 16 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 parseMarkdownContent (cyclomatic 16, cognitive 31) · ×1
  • Complex function parseMarkdownContent (cyclomatic 16, cognitive 31) mpp-vscode/webview/src/utils/codeFence.ts:158 — parseMarkdownContent has cyclomatic complexity 16 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 process (cyclomatic 16, cognitive 30) · ×1
  • Complex function process (cyclomatic 16, cognitive 30) mpp-ui/src/jsMain/typescript/processors/ModeCommandProcessor.ts:39 — process has cyclomatic complexity 16 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 handleToolCall (cyclomatic 16, cognitive 17) · ×1
  • Complex function handleToolCall (cyclomatic 16, cognitive 17) mpp-ui/src/jsMain/typescript/node-repl/server.ts:180 — handleToolCall has cyclomatic complexity 16 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 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 generateToolSummary (cyclomatic 16, cognitive 12) · ×1
  • Complex function generateToolSummary (cyclomatic 16, cognitive 12) mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:426 — generateToolSummary has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DevInToolItem (cyclomatic 16, cognitive 10) · ×1
  • Complex function DevInToolItem (cyclomatic 16, cognitive 10) mpp-vscode/webview/src/components/sketch/DevInRenderer.tsx:117 — DevInToolItem has cyclomatic complexity 16 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function formatParams (cyclomatic 16, cognitive 10) · ×1
  • Complex function formatParams (cyclomatic 16, cognitive 10) mpp-vscode/webview/src/components/sketch/ToolCallRenderer.tsx:45 — formatParams has cyclomatic complexity 16 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseCodeBlocks (cyclomatic 15, cognitive 29) · ×1
  • Complex function parseCodeBlocks (cyclomatic 15, cognitive 29) mpp-vscode/webview/src/utils/codeFence.ts:60 — parseCodeBlocks has cyclomatic complexity 15 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function analyzeTestResults (cyclomatic 15, cognitive 19) · ×1
  • Complex function analyzeTestResults (cyclomatic 15, cognitive 19) mpp-ui/scripts/analyze-test-results.cjs:12 — analyzeTestResults has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 main (cyclomatic 15, cognitive 17) · ×1
  • Complex function main (cyclomatic 15, cognitive 17) mpp-ui/scripts/publish-remote.js:44 — main has cyclomatic complexity 15 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 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 formatLLMError (cyclomatic 15, cognitive 15) · ×1
  • Complex function formatLLMError (cyclomatic 15, cognitive 15) mpp-ui/src/jsMain/typescript/agents/LLMService.ts:169 — formatLLMError has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
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 '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.
R8 · Dependency Hygiene · Unused dependency 'zod' · ×1
  • Unused dependency 'zod' — Declared in mpp-vscode/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.
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 — 921 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×631
  • 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.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-web/src/App.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/nano/components/JewelInputComponents.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/devins/document/docql/BaseDocQLExecutor.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.
  • + 606 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×50
  • redundant comment mpp-ui/scripts/convert-icon.js:14 — "Read SVG content" repeats the code it sits on: 3 of its 3 words (read, svg, content) are already in `const svgContent = fs.readFileSync(svgPath, 'utf8');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/scripts/generate-test-report.js:291 — "Generate HTML report" repeats the code it sits on: 3 of its 3 words (generate, html, report) are already in `const htmlReport = this.generateHtmlReport(metrics);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/scripts/generate-test-report.js:296 — "Generate Markdown report" repeats the code it sits on: 3 of its 3 words (generate, markdown, report) are already in `const markdownReport = this.generateMarkdownReport(metrics);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/scripts/publish-remote.js:106 — "Wait a bit for npm registry to update" repeats the code it sits on: 4 of its 5 words (wait, npm, registry, update) are already in `console.log('⏳ Waiting for npm registry to update (5 seconds)...');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/AgentMode.test.ts:94 — "Mock SlashCommandProcessor" repeats the code it sits on: 4 of its 4 words (mock, slash, command, processor) are already in `vi.mock('../processors/SlashCommandProcessor.js', () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/AgentMode.test.ts:120 — "Mock InputRouter" repeats the code it sits on: 3 of its 3 words (mock, input, router) are already in `vi.mock('../processors/InputRouter.js', () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/AgentMode.test.ts:155 — "Mock domain dict utils" repeats the code it sits on: 4 of its 4 words (mock, domain, dict, utils) are already in `vi.mock('../utils/domainDictUtils.js', () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/DomainDictService.test.ts:8 — "Mock mpp-core" repeats the code it sits on: 3 of its 3 words (mock, mpp, core) are already in `vi.mock('@xiuper/mpp-core', () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/InitCommand.test.ts:56 — "Mock ConfigManager" repeats the code it sits on: 3 of its 3 words (mock, config, manager) are already in `vi.mock('../config/ConfigManager.js', () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/__tests__/TuiIntegration.test.ts:87 — 7 comments in this file only repeat the code they sit on (lines 87, 99, 134, 145, 156, 236, 241), for example "Mock SlashCommandProcessor". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/LLMService.ts:36 — "Create JsModelConfig" repeats the code it sits on: 4 of its 4 words (create, js, model, config) are already in `const modelConfig = new JsModelConfig(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/LLMService.ts:46 — "Create JsKoogLLMService" repeats the code it sits on: 5 of its 5 words (create, js, koog, llm, service) are already in `this.koogService = new JsKoogLLMService(modelConfig);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:75 — "Create LLM service" repeats the code it sits on: 3 of its 3 words (create, llm, service) are already in `const llmService = new KotlinCC.unitmesh.llm.JsKoogLLMService(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/acp/AcpAgentServer.ts:107 — "Create CodingAgent" repeats the code it sits on: 3 of its 3 words (create, coding, agent) are already in `const agent = new KotlinCC.unitmesh.agent.JsCodingAgent(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/render/CliRenderer.ts:115 — "Extract thinking content" repeats the code it sits on: 3 of its 3 words (extract, thinking, content) are already in `const extraction = this.extractThinkingContent(this.reasoningBuffer);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/agents/render/ServerRenderer.ts:237 — "Process the buffer to filter out devin blocks" repeats the code it sits on: 5 of its 5 words (process, buffer, filter, devin, blocks) are already in `const processedContent = this.filterDevinBlocks(this.reasoningBuffer);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/config/ConfigManager.ts:150 — "Check if config with this name exists" repeats the code it sits on: 4 of its 4 words (check, config, name, exists) are already in `const existingIndex = configFile.configs.findIndex(c => c.name === config.name);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/index.tsx:64 — 8 comments in this file only repeat the code they sit on (lines 64, 124, 145, 356, 382, 394, 445, 525), for example "Resolve project path". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:90 — "Show welcome message" repeats the code it sits on: 3 of its 3 words (show, welcome, message) are already in `const welcomeMessage: Message = {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/modes/CodexMode.ts:169 — "Add user message" repeats the code it sits on: 3 of its 3 words (add, user, message) are already in `context.addMessage({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/modes/ReviewMode.ts:116 — "Create code review agent" repeats the code it sits on: 4 of its 4 words (create, code, review, agent) are already in `const reviewAgent = new KotlinCC.unitmesh.agent.JsCodeReviewAgent(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts:100 — "Get project path" repeats the code it sits on: 3 of its 3 words (get, project, path) are already in `const projectPath = getCurrentProjectPath();`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/processors/SkillCommandProcessor.ts:109 — "Get skill manager" repeats the code it sits on: 3 of its 3 words (get, skill, manager) are already in `const manager = await getSkillManager(projectPath);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/processors/SlashCommandProcessor.ts:108 — 7 comments in this file only repeat the code they sit on (lines 108, 115, 314, 317, 320, 338, 442), for example "deep-research - Deep Research for domain dictionary". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment mpp-ui/src/jsMain/typescript/ui/ChatInterface.tsx:88 — "Create file system" repeats the code it sits on: 3 of its 3 words (create, file, system) are already in `const fileSystem = KotlinCC.unitmesh.devins.filesystem.JsFileSystemFactory.Companion.createFileSystem(projectPath);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 25 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • 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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/changes/IdeaFileChangeDiffDialog.kt:271 — `error` at line 271 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:42 — `warn` 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.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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:89 — `info` at line 89 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:136 — `info` at line 136 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:142 — `warn` at line 142 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:145 — `warn` at line 145 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/src/main/kotlin/cc/unitmesh/devins/idea/terminal/TerminalApiCompat.kt:167 — `warn` at line 167 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:66 — `error` 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.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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinAutoTestService.kt:94 — `error` at line 94 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:34 — `error` at line 34 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:53 — `error` at line 53 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:64 — `error` at line 64 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:67 — `info` 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.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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:78 — `warn` at line 78 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinCodeModifier.kt:94 — `info` at line 94 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:126 — `error` at line 126 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-lang/kotlin/src/main/kotlin/cc/unitmesh/kotlin/provider/KotlinLivingDocumentation.kt:132 — `error` at line 132 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/JavaScriptContextProvider.kt:35 — `info` 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.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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:54 — `warn` at line 54 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:60 — `error` at line 60 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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:66 — `error` 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.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-lang/javascript/src/main/kotlin/cc/unitmesh/ide/javascript/provider/testing/JSAutoTestService.kt:156 — `warn` at line 156 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-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:73 — `error` at line 73 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-lang/java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt:100 — `error` at line 100 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.
  • + 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/webpack.config.d/node-polyfills.js:77 — `mpp-ui/webpack.config.d/node-polyfills.js` reports through `console.*` at line 77 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/utils/commandUtils.ts:48 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 48 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/utils/commandUtils.ts:55 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 55 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/utils/commandUtils.ts:57 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 57 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/utils/commandUtils.ts:60 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 60 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/utils/commandUtils.ts:63 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 63 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/utils/commandUtils.ts:66 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 66 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/utils/commandUtils.ts:67 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 67 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/utils/commandUtils.ts:86 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 86 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/utils/commandUtils.ts:88 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 88 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/utils/commandUtils.ts:91 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 91 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/utils/commandUtils.ts:92 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 92 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/utils/commandUtils.ts:110 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 110 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/utils/commandUtils.ts:148 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.ts` reports through `console.*` at line 148 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/utils/commandUtils.ts:169 — `mpp-ui/src/jsMain/typescript/utils/commandUtils.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/utils/outputFormatter.ts:28 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 28 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/utils/outputFormatter.ts:29 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 29 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/utils/outputFormatter.ts:30 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 30 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/utils/outputFormatter.ts:37 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 37 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/utils/outputFormatter.ts:44 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 44 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/utils/outputFormatter.ts:51 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 51 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/utils/outputFormatter.ts:58 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 58 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/utils/outputFormatter.ts:65 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.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/utils/outputFormatter.ts:73 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 73 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/utils/outputFormatter.ts:82 — `mpp-ui/src/jsMain/typescript/utils/outputFormatter.ts` reports through `console.*` at line 82 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-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.
  • Silent fallback default in catch mpp-core/src/jvmMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.jvm.kt:100 — `extractTableNames` 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/jvmMain/kotlin/cc/unitmesh/agent/tool/gitignore/GitIgnoreParser.jvm.kt:69 — `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/jvmMain/kotlin/cc/unitmesh/agent/tool/shell/ShellEnvironmentUtils.kt:46 — `loadLoginShellEnvironment` swallows every exception into `emptyMap()` — 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/jvmMain/kotlin/cc/unitmesh/devins/filesystem/DefaultFileSystem.jvm.kt:101 — `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/wasmJsMain/kotlin/cc/unitmesh/agent/platform/GitLogParser.kt:163 — `parseGitDate` 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-core/src/wasmJsMain/kotlin/cc/unitmesh/agent/tool/filesystem/WasmJsToolFileSystem.kt:126 — `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-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.
  • + 9 more in this group — see findings.md.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×24
  • 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.
  • 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/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-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-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-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/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/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/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/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/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/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.
P10 · Library API & versioning · Implementation type on the public API · ×14
  • Implementation type on the public API mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:1 — 81 public types in `cc.unitmesh.agent.tool.impl` are marked as implementation by their own namespace, folder or name: `AndroidCodeParserFactoryKt` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:1, `impl`), `AskSubAgentParams` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:14, `impl`), `AskSubAgentSchema` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:23, `impl`), `AskAgentTool` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/AskAgentTool.kt:50, `impl`), `CodebaseInsightsToolKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:1, `impl`), `CodebaseInsightsSchema` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:24, `impl`), `CodebaseInsightsParams` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:48, `impl`), `CodebaseInsightsResult` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/CodebaseInsightsTool.kt:58, `impl`), and 73 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:15 — 12 public types in `cc.unitmesh.agent.tool.impl.http` are marked as implementation by their own namespace, folder or name: `HttpClientFactory` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpClientFactory.android.kt:15, `impl`), `HttpFetcherFactory` (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/HttpFetcherFactory.android.kt:8, `impl`), `KtorHttpFetcher` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:20, `impl`), `ParsedUrls` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:6, `impl`), `UrlParser` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/UrlParser.kt:14, `impl`), `NodeFetchHttpFetcher` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:17, `impl`), `AbortController` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:138, `impl`), `AbortSignal` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:143, `impl`), and 4 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/DocQLTool.kt:494 — 1 public type in `cc.unitmesh.agent.tool.impl.DocQLTool` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/DocQLTool.kt:494, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:93 — 1 public type in `cc.unitmesh.agent.tool.impl.GlobInvocation` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/GlobTool.kt:93, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14 — 5 public types in `cc.unitmesh.agent.tool.impl.PlanAction` are marked as implementation by their own namespace, folder or name: `CREATE` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `UPDATE` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `COMPLETE_STEP` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `FAIL_STEP` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`), `VIEW` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/PlanManagementTool.kt:14, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:1 — 21 public types in `cc.unitmesh.agent.tool.impl.docql` are marked as implementation by their own namespace, folder or name: `DocQLDirectQueryExecutorKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:1, `impl`), `DocQLDirectQueryExecutor` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLDirectQueryExecutor.kt:17, `impl`), `DocQLKeywordSearchExecutorKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLKeywordSearchExecutor.kt:1, `impl`), `DocQLKeywordSearchExecutor` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLKeywordSearchExecutor.kt:33, `impl`), `DocQLResultFormatter` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultFormatter.kt:16, `impl`), `DocQLResultRerankerKt` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:1, `impl`), `DocQLResultReranker` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:31, `impl`), `SearchItem` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLResultReranker.kt:206, `impl`), and 13 more. While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:56 — 2 public types in `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats` are marked as implementation by their own namespace, folder or name: `SearchType` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:56, `impl`), `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:137, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:57 — 4 public types in `cc.unitmesh.agent.tool.impl.docql.DocQLSearchStats.SearchType` are marked as implementation by their own namespace, folder or name: `SMART_SEARCH` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:57, `impl`), `DIRECT_QUERY` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:58, `impl`), `FALLBACK_CONTENT` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:59, `impl`), `LLM_RERANKED` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:60, `impl`). While they are public, every consumer of the library can bind to them, so changing them is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:184 — 1 public type in `cc.unitmesh.agent.tool.impl.docql.RerankerStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:184, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:212 — 1 public type in `cc.unitmesh.agent.tool.impl.docql.ScoringStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:212, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:249 — 1 public type in `cc.unitmesh.agent.tool.impl.docql.KeywordExpansionStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:249, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:291 — 1 public type in `cc.unitmesh.agent.tool.impl.docql.LLMRerankerStats` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/docql/DocQLSearchStats.kt:291, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:104 — 1 public type in `cc.unitmesh.agent.tool.impl.http.KtorHttpFetcher` is marked as implementation by its own namespace, folder or name: `Companion` (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/tool/impl/http/KtorHttpFetcher.kt:104, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
  • Implementation type on the public API mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:1 — 1 public type in `cc.unitmesh.agent.tool.impl.http.NodeFetchHttpFetcher` is marked as implementation by its own namespace, folder or name: `jsKt` (mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/tool/impl/NodeFetchHttpFetcher.js.kt:1, `impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
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.
M4 · Documentation accuracy · README/code drift · ×2
  • 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-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 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 render.yaml:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `render.yaml` makes this repository a deployable product (line 1).
D21 · Naming Consistency · `parseJSNodes` spells `JS` where 44 names in the project spell it `Js` · ×1
  • `parseJSNodes` spells `JS` where 44 names in the project spell it `Js` mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:179 — 44 of 45 names in project mpp-core spell the token `Js` (44 of 45; unit: names in project mpp-core containing `Js`). Peers: Platform.isJs (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/Platform.kt:9); AndroidCodeParser.extractJsImports (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/tool/impl/AndroidCodeParserFactory.kt:131); Platform.isJs (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/Platform.kt:9); LoggingInitializer.initializeJs (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/logging/LoggingInitializer.kt:74); ImportDependencyClusterer.extractJsImportsRegex (mpp-core/src/commonMain/kotlin/cc/unitmesh/indexer/clustering/ImportDependencyClusterer.kt:239). Rename to `parseJsNodes`. [rule N6]
D21 · Naming Consistency · `SchemaLinkingLlmResult` spells `Llm` where 36 names in the project spell it `LLM` · ×1
  • `SchemaLinkingLlmResult` spells `Llm` where 36 names in the project spell it `LLM` mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/LlmSchemaLinker.kt:72 — 36 of 37 names in project mpp-core spell the token `LLM` (36 of 37; unit: names in project mpp-core containing `LLM`). Peers: CodeReviewAgent.enableLLMStreaming (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodeReviewAgent.kt:88); CodingAgent.enableLLMStreaming (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgent.kt:51); ChatDBAgent.enableLLMStreaming (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBAgent.kt:47); DocumentAgent.enableLLMStreaming (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/document/DocumentAgent.kt:59); BaseAgentExecutor.enableLLMStreaming (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/executor/BaseAgentExecutor.kt:20). Rename to `SchemaLinkingLLMResult`. [rule N6]
D21 · Naming Consistency · `invalidSQL` spells `SQL` where 27 names in the project spell it `Sql` · ×1
  • `invalidSQL` spells `SQL` where 27 names in the project spell it `Sql` mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/database/DatabaseConnection.kt:448 — 27 of 29 names in project mpp-core spell the token `Sql` (27 of 29; unit: names in project mpp-core containing `Sql`). Peers: SqlValidator.detectSqlType (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:88); MultiDatabaseChatDBExecutor.buildResultMessage(generatedSql) (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:882); MultiDatabaseChatDBExecutor.buildMultiDatabaseSqlPrompt (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1002); MultiDatabaseChatDBExecutor.parseSqlBlocksWithTargets (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1022); MultiDatabaseChatDBExecutor.extractDatabaseFromSql (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1048). Rename to `invalidSql`. [rule N6]
D21 · Naming Consistency · `parseSQLFluffOutput` spells `SQL` where 27 names in the project spell it `Sql` · ×1
  • `parseSQLFluffOutput` spells `SQL` where 27 names in the project spell it `Sql` mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/linter/linters/SQLFluffLinter.kt:25 — 27 of 29 names in project mpp-core spell the token `Sql` (27 of 29; unit: names in project mpp-core containing `Sql`). Peers: SqlValidator.detectSqlType (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/subagent/SqlValidator.android.kt:88); MultiDatabaseChatDBExecutor.buildResultMessage(generatedSql) (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:882); MultiDatabaseChatDBExecutor.buildMultiDatabaseSqlPrompt (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1002); MultiDatabaseChatDBExecutor.parseSqlBlocksWithTargets (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1022); MultiDatabaseChatDBExecutor.extractDatabaseFromSql (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/chatdb/ChatDBExecutor.kt:1048). Rename to `parseSqlFluffOutput`. [rule N6]
D21 · Naming Consistency · `inShadowDom` spells `Dom` where 12 names in the project spell it `DOM` · ×1
  • `inShadowDom` spells `Dom` where 12 names in the project spell it `DOM` mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/model/PageState.kt:166 — 12 of 13 names in project mpp-core spell the token `DOM` (12 of 13; unit: names in project mpp-core containing `DOM`). Peers: PageStateExtractor.extractCleanDOM (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.android.kt:16); AndroidPageStateExtractor.extractCleanDOM (mpp-core/src/androidMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.android.kt:47); PageStateExtractor.extractCleanDOM (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.kt:35); PageStateExtractorConfig.includeShadowDOM (mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.kt:105); PageStateExtractor.extractCleanDOM (mpp-core/src/iosMain/kotlin/cc/unitmesh/agent/webagent/perception/PageStateExtractor.ios.kt:19). Rename to `inShadowDOM`. [rule N6]
D21 · Naming Consistency · `loadURL` spells `URL` where 44 names in the project spell it `Url` · ×1
  • `loadURL` spells `URL` where 44 names in the project spell it `Url` mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/WebViewWindow.kt:100 — 44 of 45 names in project mpp-idea spell the token `Url` (44 of 45; unit: names in project mpp-idea containing `Url`). Peers: ToolAgentCard.documentationUrl (mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/AutodevToolAgentCard.kt:107); Companion.create(providerUrl) (mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/AutodevToolAgentCard.kt:216); A2AAgentListPanel.createServerSection(serverUrl) (mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:136); A2AAgentListPanel.updateServerSection(serverUrl) (mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:173); A2AAgentListPanel.showServerError(serverUrl) (mpp-idea/mpp-idea-core/src/main/kotlin/cc/unitmesh/devti/a2a/ui/A2AAgentListPanel.kt:215). Rename to `loadUrl`. [rule N6]
D21 · Naming Consistency · `determineGradleDslType` spells `Dsl` where 17 names in the project spell it `DSL` · ×1
  • `determineGradleDslType` spells `Dsl` where 17 names in the project spell it `DSL` mpp-idea/mpp-idea-lang/java/src/main/kotlin/cc/unitmesh/idea/provider/JavaBuildSystemProvider.kt:65 — 17 of 18 names in project mpp-idea spell the token `DSL` (17 of 18; unit: names in project mpp-idea containing `DSL`). Peers: cc.unitmesh.nanodsl.language.NanoDSLFileType (mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLFileType.kt:6); cc.unitmesh.nanodsl.language.NanoDSLIcons (mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLIcons.kt:6); cc.unitmesh.nanodsl.language.NanoDSLLanguage (mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/NanoDSLLanguage.kt:5); cc.unitmesh.nanodsl.language.highlight.NanoDSLSyntaxHighlighter (mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/highlight/NanoDSLSyntaxHighlighter.kt:14); cc.unitmesh.nanodsl.language.highlight.NanoDSLSyntaxHighlighterFactory (mpp-idea/mpp-idea-exts/nanodsl-lang/src/main/kotlin/cc/unitmesh/nanodsl/language/highlight/NanoDSLSyntaxHighlighterFactory.kt:7). Rename to `determineGradleDSLType`. [rule N6]
D21 · Naming Consistency · `getDb` spells `Db` where 17 names in the project spell it `DB` · ×1
  • `getDb` spells `Db` where 17 names in the project spell it `DB` mpp-ui/src/wasmJsMain/kotlin/cc/unitmesh/devins/db/IndexedDBSqlDriver.kt:113 — 17 of 18 names in project mpp-ui spell the token `DB` (17 of 18; unit: names in project mpp-ui containing `DB`). Peers: ComposeRenderer.renderChatDBStep (mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/ComposeRenderer.kt:1148); cc.unitmesh.devins.ui.compose.agent.chatdb.ChatDBPageKt (mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt:1); ChatDBPageKt.ChatDBPage (mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBPage.kt:24); cc.unitmesh.devins.ui.compose.agent.chatdb.ChatDBViewModel (mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/ChatDBViewModel.kt:31); cc.unitmesh.devins.ui.compose.agent.chatdb.components.ChatDBChatPaneKt (mpp-ui/src/commonMain/kotlin/cc/unitmesh/devins/ui/compose/agent/chatdb/components/ChatDBChatPane.kt:1). Rename to `getDB`. [rule N6]
D21 · Naming Consistency · `NanoDSL` spells `DSL` where 16 names in the project spell it `Dsl` · ×1
  • `NanoDSL` spells `DSL` where 16 names in the project spell it `Dsl` xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/dsl/NanoDSL.kt:39 — 16 of 17 names in project xiuper-ui spell the token `Dsl` (16 of 17; unit: names in project xiuper-ui containing `Dsl`). Peers: Evaluator.evaluate(actualDsl) (xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:36); EvaluatorRegistry.evaluateAll(actualDsl) (xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:72); SyntaxEvaluator.evaluate(actualDsl) (xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:86); ComponentMatchEvaluator.evaluate(actualDsl) (xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:109); StructureEvaluator.evaluate(actualDsl) (xiuper-ui/src/commonMain/kotlin/cc/unitmesh/xuiper/eval/evaluator/Evaluator.kt:122). Rename to `NanoDsl`. [rule N6]
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) — 631 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-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialog.kt, mpp-ui/src/jvmMain/kotlin/cc/unitmesh/server/cli/ReviewCli.kt (and 623 more) (640 orphaned of 1334 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1334 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.
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`.
P3 · Security & performance tooling · Dependabot does not watch npm/pip · ×1
  • Dependabot does not watch npm/pip REDACTED:5 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, `pip`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
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, got, undici, node:http; 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.
Minor — 2 finding(s)
D24 · Comment Value · doc comments repeat the names · ×2
  • doc comments repeat the names mpp-ui/scripts/generate-test-report.js:103 — 0 of 10 documented parameters and 7 of 170 summaries in `@xiuper/cli` only repeat the member or parameter name (e.g. "Generate HTML report" for `generateHtmlReport`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names mpp-vscode/src/bridge/mpp-core.ts:236 — 1 of 3 documented parameters and 7 of 117 summaries in `autodev` only repeat the member or parameter name (e.g. "Read a file" for `readFile`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-25fea10fd92a49deab3ba965bcc39ef0/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/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-25fea10fd92a49deab3ba965bcc39ef0/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .96artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .2artifacts/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/** .0artifacts/raw/trivy-fs.json

Run 01a1d6af-6c37-7e86-9804-d200e02c7204 · 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