{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D7","name":"Architectural Integrity","shortDescription":{"text":"Architectural Integrity"},"helpUri":"https://codehealth.canine.dev/dimensions/D7"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D31","name":"IaC \u0026 Container Security","shortDescription":{"text":"IaC \u0026 Container Security"},"helpUri":"https://codehealth.canine.dev/dimensions/D31","relationships":[{"target":{"id":"CWE-1032","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-16","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"]}},{"id":"D33","name":"JS/npm Dependency Vulnerabilities","shortDescription":{"text":"JS/npm Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D33","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"config.v0ProvidersMapToModelList (cyclomatic 212): config.v0ProvidersMapToModelList has cyclomatic complexity 212 (threshold 15). Most of this is not in the body itself: 12 of the 212 points are its own statements and the rest belongs to 25 function literals inside it that branch (lines 46, 73, 97, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e8100caedbdc4c1a10b99288ed0c79c2e2d0630be0c04bd11f192fd588d2950"}},{"ruleId":"D1","level":"warning","message":{"text":"Pipeline.ExecuteTools (cyclomatic 112): Pipeline.ExecuteTools has cyclomatic complexity 112 (threshold 15). Of this number, 107 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"c528241844b7d5f8207157a32b4ac7e2a30944c67e69ace8b6f45942dc497b33"}},{"ruleId":"D1","level":"warning","message":{"text":"Pipeline.CallLLM (cyclomatic 103): Pipeline.CallLLM has cyclomatic complexity 103 (threshold 15). Of this number, 88 points are the body\u0027s own statements and 15 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3dfcb36ca63ed25b31b87381769ec4f24c08b02b2b34036d31fa9acd6bf7744"}},{"ruleId":"D1","level":"warning","message":{"text":"converter.walk (cyclomatic 70): converter.walk has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/markdown.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3a8f2d2708521110b3246cba2f62e71b3a5ec81f720a8746a8fef0c00d7062f"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 60): main.main has cyclomatic complexity 60 (threshold 15). Of this number, 55 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d64bdb208e07732abed05b1966582b5e138ca71de1d66e8ee4067d25b680e61"}},{"ruleId":"D1","level":"warning","message":{"text":"providers.CreateProviderFromConfig (cyclomatic 56): providers.CreateProviderFromConfig has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory_provider.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba401641a420171b5741cf00346b7552459e64a46b8161853970c7a44aa635d5"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.askSideQuestion (cyclomatic 47): AgentLoop.askSideQuestion has cyclomatic complexity 47 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_coord.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a669fe79e016e787aebcb8a83eb0631ea6571aa2e142c363fa3ceb360951ec5"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.registerSharedTools (cyclomatic 47): agent.registerSharedTools has cyclomatic complexity 47 (threshold 15). Of this number, 33 points are the body\u0027s own statements and 14 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_init.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe1b171af029238abba3c3f24b840b9bf22ee8b368a004153d91e5486182b8b1"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.runTurn (cyclomatic 45): AgentLoop.runTurn has cyclomatic complexity 45 (threshold 15). Of this number, 43 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_coord.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fc62fcef1e6b97dbb0b396087ee280459c279f5737119b51c28be3d310c19a3"}},{"ruleId":"D1","level":"warning","message":{"text":"OpenClawConfig.convertChannels (cyclomatic 45): OpenClawConfig.convertChannels has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/sources/openclaw/openclaw_config.go"},"region":{"startLine":773}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4debd3472bb2cf728ca7bda73fa4619b419f655a604cb53a66fd5afbc83bc94"}},{"ruleId":"D1","level":"warning","message":{"text":"Runtime.RunColdPathOnce (cyclomatic 44): Runtime.RunColdPathOnce has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"84cba0670f566aed4c7aca08b89726488885292101db4c63aef9a3ed5162e3f9"}},{"ruleId":"D1","level":"warning","message":{"text":"WebSearchToolOptions.providerByName (cyclomatic 43): WebSearchToolOptions.providerByName has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1655}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f1f04796effd6a0e8782284f71c01242b1ca5d5e5e864a0ac9eba338ebb660"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.buildCommandsRuntime (cyclomatic 42): AgentLoop.buildCommandsRuntime has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 5 of the 42 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 140, 299, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_command.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd12fba279fa7b05f69ebef44f397c04f8ab3a9d750ab9965b16cf4927062e41"}},{"ruleId":"D1","level":"warning","message":{"text":"Engine.Bootstrap (cyclomatic 40): Engine.Bootstrap has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_engine.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6472c3a68a226fd3370442df31b03cf861426af3e39fd8cbe292f6a2db0f2e5"}},{"ruleId":"D1","level":"warning","message":{"text":"channels.hiddenValues (cyclomatic 39): channels.hiddenValues has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager_channel.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"d559c3ea239fb1f6e130f6388caaeab0806b5ac825d06cf9e3e21ce5a86b15d8"}},{"ruleId":"D1","level":"warning","message":{"text":"config.LoadConfig (cyclomatic 39): config.LoadConfig has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1293}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed9e621be6634192138d7e4f6cf8f08aa132516263d913e24f9a13723147d309"}},{"ruleId":"D1","level":"warning","message":{"text":"ReadFileLinesTool.Execute (cyclomatic 39): ReadFileLinesTool.Execute has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":536}}}],"partialFingerprints":{"codehealthFindingId/v1":"a823384fa57a0ad28585e6099cf4806ab05f3881d4a1d7ccb4160ecc7e1c3ecb"}},{"ruleId":"D1","level":"warning","message":{"text":"updater.findAssetInfo (cyclomatic 39): updater.findAssetInfo has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/updater/updater.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1878b27220bfeb40c768fdebdbdc3e470367eceb68567c963f55fe92a10f306"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.preSend (cyclomatic 38): Manager.preSend has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd18bec3ac2b50f1369e71031277fd4f8ab19de4495a6f3767cd31536540099b"}},{"ruleId":"D1","level":"warning","message":{"text":"CompactionEngine.compactCondensed (cyclomatic 38): CompactionEngine.compactCondensed has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"825b63033407fc64b267d433c95e75d4d28f62942614168c8207ecd245ec3e4d"}},{"ruleId":"D1","level":"warning","message":{"text":"utils.IsPrivateOrRestrictedIP (cyclomatic 38): utils.IsPrivateOrRestrictedIP has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/http_guard.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9af7821abf0bdabe531ce166f3304f62c450a0e780f249aa114d64c92aaf169"}},{"ruleId":"D1","level":"warning","message":{"text":"openai_compat.parseStreamResponse (cyclomatic 37): openai_compat.parseStreamResponse has cyclomatic complexity 37 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 19 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d6e14e02d8b24e95b0dfaad9a8a8327fb61715eddc795b5cde6a212ab3a0e4d"}},{"ruleId":"D1","level":"warning","message":{"text":"api.validateConfig (cyclomatic 37): api.validateConfig has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"85212602ba0cd847b4a3ddc38a724875bc54f02191f54e73a4dd429fdae9145c"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecTool.runBackground (cyclomatic 36): ExecTool.runBackground has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 647, 608, 586). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"53685dbb91566ba56bbb6aa8c19d499abc12ac6e01c900e3074d5476fa64d1de"}},{"ruleId":"D1","level":"warning","message":{"text":"OneBotChannel.parseMessageSegments (cyclomatic 35): OneBotChannel.parseMessageSegments has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ddb39bf4a35f5a5a0c49830fcb178856628d9339daa414b9b25d48bb4a9e782"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.ensureMCPInitialized (cyclomatic 34): AgentLoop.ensureMCPInitialized has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_mcp.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fb7514b24400b7efd057c923e27e0c073020d5300c1b3ba385b5a04327b1d07"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.getChannelConfigAndEnabled (cyclomatic 33): Manager.getChannelConfigAndEnabled has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case\u0027s concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases \u2014 they stay explicit and reviewable."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"d74395587c5f28062d7104614a5b4831ac15a733b61dbf49a277f44a647b5734"}},{"ruleId":"D1","level":"warning","message":{"text":"WebFetchTool.Execute (cyclomatic 33): WebFetchTool.Execute has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":2099}}}],"partialFingerprints":{"codehealthFindingId/v1":"166806ee71c8abde48ff670ef6e4ca73b85fef81c71b3f650f9ab5303554ca14"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.NewAgentInstance (cyclomatic 32): agent.NewAgentInstance 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/instance.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f9cc2216a634f37605cb7416e9ec21bf62794a113fe76cfe3e3996ee2c6dee2"}},{"ruleId":"D1","level":"warning","message":{"text":"mcp.parseAddArgs (cyclomatic 31): mcp.parseAddArgs has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/add.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"51e7a9859168a63e45445f5b63efb0e6f15dadc3100bef31ea18be1492acc246"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.sanitizeHistoryForProvider (cyclomatic 31): agent.sanitizeHistoryForProvider has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"99ee661e2346acd0cdcf3ecbd3c7484b392140f47d1f677c3583d71fdabf6254"}},{"ruleId":"D1","level":"warning","message":{"text":"GeminiProvider.buildRequestBody (cyclomatic 31): GeminiProvider.buildRequestBody has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"019e4e19db6f684d079222234a96b7c12ed3a5ba0945e63aa5de9c3bd0c933c6"}},{"ruleId":"D1","level":"warning","message":{"text":"Assembler.Assemble (cyclomatic 31): Assembler.Assemble has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_assembler.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"47a3d2811d5e60187b8e521b60ed265fd9d8fcc7f15bd7c0141af7dbe27ba1d6"}},{"ruleId":"D1","level":"warning","message":{"text":"TelegramChannel.handleMessages (cyclomatic 30): TelegramChannel.handleMessages has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":1036}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd0ec015b92c985d1e0f083078500656c030297f658f8449530dde4760059e3b"}},{"ruleId":"D1","level":"warning","message":{"text":"anthropicmessages.buildRequestBody (cyclomatic 30): anthropicmessages.buildRequestBody has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic_messages/provider.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"af0821df59a3650ad1324917bcb4c9f13ace14e9e6b52b4d9281599067429501"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecTool.guardCommand (cyclomatic 30): ExecTool.guardCommand has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":1152}}}],"partialFingerprints":{"codehealthFindingId/v1":"58888958cc9ac2c66fb60062d769356e20e38a1cb5bb5a21304c7b62ae043d02"}},{"ruleId":"D1","level":"warning","message":{"text":"DeltaChatChannel.handleMessage (cyclomatic 29): DeltaChatChannel.handleMessage has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/handler.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"65793eea1b24387551cca37cd07c1f347dbb9d4957beb189cc701c50c5a623db"}},{"ruleId":"D1","level":"warning","message":{"text":"gateway.Run (cyclomatic 29): gateway.Run has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"585e3fbd656131e1ce845aecffed976d179baee0b66ad0f531af34dcf85c00ef"}},{"ruleId":"D1","level":"warning","message":{"text":"anthropicprovider.buildParams (cyclomatic 29): anthropicprovider.buildParams has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic/provider.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e3e850f328fe72e26dd63f1a912fe763e16173c10fec310d23f984fc6931818"}},{"ruleId":"D1","level":"warning","message":{"text":"CompactionEngine.compactLeaf (cyclomatic 29): CompactionEngine.compactLeaf has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"19c3a48898bf2ed94794aa483966d779a6948f8b9f1a89f80426069dd34601cb"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.startGatewayLocked (cyclomatic 29): Handler.startGatewayLocked has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1116, 1096). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":1008}}}],"partialFingerprints":{"codehealthFindingId/v1":"50d10774a75fa1918cd4086434dd19d2a8c414aabed692e84eeff4b66cd536e4"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.appendEventContextFields (cyclomatic 28): agent.appendEventContextFields has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_utils.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"adb4e684ef0b70920945311bbbee4bb682fac2db08319accac253341707bfdc0"}},{"ruleId":"D1","level":"warning","message":{"text":"LINEChannel.processEvent (cyclomatic 28): LINEChannel.processEvent has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/line.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0987211552e48cd98917966f1c4e4e755ddb5484b4d0fad5f9a77897d8bfacd"}},{"ruleId":"D1","level":"warning","message":{"text":"TelegramChannel.Send (cyclomatic 28): TelegramChannel.Send has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"82d41c8c093ef0099727dc37d607a7eb91e8c5655d2e702d57537081d3750ef1"}},{"ruleId":"D1","level":"warning","message":{"text":"evolution.buildFallbackPatternsWithEvidence (cyclomatic 28): evolution.buildFallbackPatternsWithEvidence has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca4d50c528a2ab78db70ce8b7290eb8741d73c4e5d3718fde93801dddd038d7f"}},{"ruleId":"D1","level":"warning","message":{"text":"api.applySecureStringsToStruct (cyclomatic 28): api.applySecureStringsToStruct has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":740}}}],"partialFingerprints":{"codehealthFindingId/v1":"2de3b5807aae4de3dcc4823c5626d5e3bb551d74f0c8ab0203ccd3d6e421bbdc"}},{"ruleId":"D1","level":"warning","message":{"text":"api.computeConfigSignature (cyclomatic 28): api.computeConfigSignature has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5974fd9a0b02d747b0cecf3b509568c317a80d5eee54b69a27f1efdb266eb43"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleUpdateModel (cyclomatic 28): Handler.handleUpdateModel has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"9435027608e855614e3bffc394a1640d885f370cc71729098cdd6a16ae3572a6"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.Run (cyclomatic 27): AgentLoop.Run has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 218). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd268cef2ffcefc8b21e97fa120e35edb97b720e82bc2e196fb804d19cddaf47"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.normalizeProcessOptions (cyclomatic 27): agent.normalizeProcessOptions has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/dispatch_request.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"0189a3a634fb7dec72a932551e6c074c1467701d4ec678e7316d385368bbbb99"}},{"ruleId":"D1","level":"warning","message":{"text":"config.collectSensitive (cyclomatic 27): config.collectSensitive has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"185f444e788ac7e4f4d3641ba70cd344e846d5630f1c08a34e7f38673de1e1d3"}},{"ruleId":"D1","level":"warning","message":{"text":"InstallSkillTool.Execute (cyclomatic 27): InstallSkillTool.Execute has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/skills_install.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"a64a7aee3346a55b2b0a413e8f1fc3ecbad81c225f3142a70ca2e5c48bd1d0bd"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecTool.executeRun (cyclomatic 27): ExecTool.executeRun has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"2db206f5ec5e15b46850e6a940496aa6efb7c7c400c869573c84af63f8291d71"}},{"ruleId":"D1","level":"warning","message":{"text":"SpawnStatusTool.Execute (cyclomatic 27): SpawnStatusTool.Execute has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/spawn_status.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"246c3889d6cbc8639da7762e767d826d616b5284bba928d67eff6eda4ed876fb"}},{"ruleId":"D1","level":"warning","message":{"text":"api.applyToolState (cyclomatic 27): api.applyToolState has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"4892516847ff4dcf9056c73e6d6bcc9dd7f8ed07b13a29038f60e4551edcdde6"}},{"ruleId":"D1","level":"warning","message":{"text":"LLMClient.Complete (cyclomatic 26): LLMClient.Complete has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/llm_client.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb4f4a98a06c9c347d5bd95f5101b4ee627b6069aafa7c1f3c46e9cb9554b69b"}},{"ruleId":"D1","level":"warning","message":{"text":"DiscordChannel.handleMessage (cyclomatic 26): DiscordChannel.handleMessage has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2aa77bc3cc2fa8d0f6306b1ea9a9dfbedfc7facf830aab45e9b7112b1e259ea"}},{"ruleId":"D1","level":"warning","message":{"text":"TelegramChannel.SendMedia (cyclomatic 26): TelegramChannel.SendMedia has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"174cd8c2283c02f9ede68dd979866442581a0f1dcb2ebce474fec0441d7bc232"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.inferSkillNamesFromToolCall (cyclomatic 25): agent.inferSkillNamesFromToolCall has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"366fdbfcb35b47ff270ff0c7f40f087803c694fb3827fe83de06793bd34077d6"}},{"ruleId":"D1","level":"warning","message":{"text":"audio.SplitSentences (cyclomatic 25): audio.SplitSentences has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/sentence.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"6768bac39b4180f29a0f48786498fa643c92c6680243a4cb286a212427f0f4ef"}},{"ruleId":"D1","level":"warning","message":{"text":"channels.SplitMessage (cyclomatic 25): channels.SplitMessage has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/split.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bf4d7624b0e7f659d9dd9a4cbce35dc6f00b0b8ee91b06aa4045ef5aa59677f"}},{"ruleId":"D1","level":"warning","message":{"text":"WeixinChannel.pollLoop (cyclomatic 25): WeixinChannel.pollLoop has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/weixin.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"24329dde2e4465a85bc2dd064a7fa7f83ee6401564f952fe06c238f22f49bbbd"}},{"ruleId":"D1","level":"warning","message":{"text":"config.loadConfigMap (cyclomatic 25): config.loadConfigMap has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4a0a6269071e14e7c0f407ebc8614c7d24fe2997da21fa3c877f32cfe115c25"}},{"ruleId":"D1","level":"warning","message":{"text":"netbind.BuildPlan (cyclomatic 25): netbind.BuildPlan has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/netbind/netbind.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"da595c5de85297388f539eaff76298c7b593f84c7ff72de11310ab4b667a74f6"}},{"ruleId":"D1","level":"warning","message":{"text":"httpapi.parseGeminiStreamResponse (cyclomatic 25): httpapi.parseGeminiStreamResponse has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"de5e3755d31206832841682e50c88f845c92b33b35dc256cd944f3a91738b7c7"}},{"ruleId":"D1","level":"warning","message":{"text":"status.statusCmd (cyclomatic 24): status.statusCmd has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 46, 59, 70, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/status/helpers.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"52f51849a042ad5c56ccf11d0daf6872c3f46921ac533cde41a4a4504111ca10"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.publishPicoToolCallInterim (cyclomatic 24): AgentLoop.publishPicoToolCallInterim has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_outbound.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b129240545a42a1f2733560993ac8bc16225da6b3a87aff0e6ccd10992630e3"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.spawnSubTurn (cyclomatic 24): agent.spawnSubTurn has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/subturn.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a73b51e122c79c41da776f69ab2c7b561d9cec03044a45f4afc3fba383439db"}},{"ruleId":"D1","level":"warning","message":{"text":"MatrixChannel.handleMessageEvent (cyclomatic 24): MatrixChannel.handleMessageEvent has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/matrix/matrix.go"},"region":{"startLine":772}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d41a887141abe5ba3f97f7e906acf1cd495c77da01efdc989b334cf4b31b787"}},{"ruleId":"D1","level":"warning","message":{"text":"OneBotChannel.handleMessage (cyclomatic 24): OneBotChannel.handleMessage has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":931}}}],"partialFingerprints":{"codehealthFindingId/v1":"166169a34b568e0066309214965934cd5b387946decff13c9199a1fd40f91243"}},{"ruleId":"D1","level":"warning","message":{"text":"wecom.detectWeComMediaMetadata (cyclomatic 24): wecom.detectWeComMediaMetadata has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e8371010b5e2e1acccb3dd367aec282a2037b6849b77dd3d296ce016e4c1e68"}},{"ruleId":"D1","level":"warning","message":{"text":"WeComChannel.resolveOutboundPart (cyclomatic 24): WeComChannel.resolveOutboundPart has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"a62728974ccafe93e67369ddd95cbcef32f28fa9e479b96f6d62c51544c17fec"}},{"ruleId":"D1","level":"warning","message":{"text":"config.applySkillsRegistryEnvCompat (cyclomatic 24): config.applySkillsRegistryEnvCompat has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1554}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9d77ec946b0f191a14682159e3072fbe0a684f668564e465e42e412ddcbe8f8"}},{"ruleId":"D1","level":"warning","message":{"text":"config.applyLegacySkillsSecurityNode (cyclomatic 24): config.applyLegacySkillsSecurityNode has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"36ee2232c86573f3ee4bf5e60d3f3905c660259ddd009c041c8a0e148b9445a0"}},{"ruleId":"D1","level":"warning","message":{"text":"AntigravityProvider.buildRequest (cyclomatic 24): AntigravityProvider.buildRequest has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"f345112f3197f6224a67ee54ac53d3929c50b5d8e79e03de6ac7b21f5d335519"}},{"ruleId":"D1","level":"warning","message":{"text":"CodexProvider.Chat (cyclomatic 24): CodexProvider.Chat has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/codex_provider.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ce023c8198bde7b732a18056c933d0a5d615a4df47c4bdafb1574fe12d10517"}},{"ruleId":"D1","level":"warning","message":{"text":"GitHubRegistry.Search (cyclomatic 24): GitHubRegistry.Search has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/github_registry.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed819fea57fd874976a4a61c3a4129ebdbd54fba12043f2598edcd08ed143209"}},{"ruleId":"D1","level":"warning","message":{"text":"ReadFileTool.Execute (cyclomatic 24): ReadFileTool.Execute has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"e92edaa9e6e3fda7e41bd270232590a5142aa3b31da71a75d488dc4054f8595b"}},{"ruleId":"D1","level":"warning","message":{"text":"api.canonicalizeSignatureValue (cyclomatic 24): api.canonicalizeSignatureValue has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c4c5fef6f5dd9d7f9dee1efce8d917ffdcacd0308285219f9965e9e9fea4da8"}},{"ruleId":"D1","level":"warning","message":{"text":"modelProbeCacheState.gc (cyclomatic 24): modelProbeCacheState.gc has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/model_status.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"7390ce13e2f95bad14f9b24c2c085a8be122d94835114bf07b76ddeae7c501ee"}},{"ruleId":"D1","level":"warning","message":{"text":"main.runEval (cyclomatic 23): main.runEval has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/main.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e17ec9003c2c1f070381fb2ff67f78814a65ce129755e5d88d2ba9c5d403090"}},{"ruleId":"D1","level":"warning","message":{"text":"Pipeline.SetupTurn (cyclomatic 23): Pipeline.SetupTurn has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_setup.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"811f93d79d26eb17d7495f3616b9fb2dd48eaadc95737c45cd484c2cf52fc613"}},{"ruleId":"D1","level":"warning","message":{"text":"WeixinChannel.handleInboundMessage (cyclomatic 23): WeixinChannel.handleInboundMessage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/weixin.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"33b9c06f546b3402a79e39c896832f0311ba9d8b2e1719fc70322714eb08b78e"}},{"ruleId":"D1","level":"warning","message":{"text":"api.applyConfigSecretsFromMap (cyclomatic 23): api.applyConfigSecretsFromMap has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"d864e65c8c75d2a54958dded9c60bb4b20c09f2e581ad7c05ea3cf648d2ece2f"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleUpdateWebSearchConfig (cyclomatic 23): Handler.handleUpdateWebSearchConfig has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"aee631e18cc7611f682dc4f34a27291f32c4c22d06549928f1acdd4bc0f70392"}},{"ruleId":"D1","level":"warning","message":{"text":"BaseChannel.HandleMessageWithContext (cyclomatic 22): BaseChannel.HandleMessageWithContext has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/base.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"a51fb495fc1c9395282fe3d1bdce4ce8bd3ba9e7bf7947a0ea32b90ade1ccf6a"}},{"ruleId":"D1","level":"warning","message":{"text":"DeltaChatChannel.ensureAccount (cyclomatic 22): DeltaChatChannel.ensureAccount has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/deltachat.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"340c842974049d536aceea95f9588f97ea9c969f91e4e95813947f82b8e85a29"}},{"ruleId":"D1","level":"warning","message":{"text":"DiscordChannel.receiveVoice (cyclomatic 22): DiscordChannel.receiveVoice has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/voice.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8a3760efb884a0a7ebbf69050776b8d715a102c032bbf7372b2cc6fb4aadc7b"}},{"ruleId":"D1","level":"warning","message":{"text":"qq.qqWAVDuration (cyclomatic 22): qq.qqWAVDuration has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/audio_duration.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bb1fb3f8c1f2c03eff0ead1b6931217605726dec7bb2d45b008b43efcde6b1d"}},{"ruleId":"D1","level":"warning","message":{"text":"slackwebhook.renderTable (cyclomatic 22): slackwebhook.renderTable has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack_webhook/convert.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6d5e49a06a31fb43570f416814ab8d6d078abf35c80a735b0734b5c39e06c5c"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleSearchSkills (cyclomatic 22): Handler.handleSearchSkills has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cbd636183fd0bfa49b7d530014e60a05f8ee7fb6338c7da9e86fce4d76d6ee4"}},{"ruleId":"D1","level":"warning","message":{"text":"FeishuChannel.handleMessageReceive (cyclomatic 21): FeishuChannel.handleMessageReceive has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":583}}}],"partialFingerprints":{"codehealthFindingId/v1":"7349da7778b29e945381ed28537e57296fbc1e6b2b142371d3e1432c2e0bcccd"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.StartAll (cyclomatic 21): Manager.StartAll has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1214}}}],"partialFingerprints":{"codehealthFindingId/v1":"590c594626b5ae349d7b6bbb6baa0ba54d449a3087702b665b7b2d28a11ce5de"}},{"ruleId":"D1","level":"warning","message":{"text":"WeComChannel.dispatchIncoming (cyclomatic 21): WeComChannel.dispatchIncoming has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa37a5ac11e1aae8670fb02bfe990e374d5de12f869f46166e3b146fcbeade11"}},{"ruleId":"D1","level":"warning","message":{"text":"geminiSchemaSanitizer.mergeUnionBranches (cyclomatic 21): geminiSchemaSanitizer.mergeUnionBranches has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb8cab817fccf81defe9329db7835aa3a029eb1bf1e803c405ed811df64c52ab"}},{"ruleId":"D1","level":"warning","message":{"text":"RetrievalEngine.Grep (cyclomatic 21): RetrievalEngine.Grep has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_retrieval.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"b63712b93e0ea7c72de818aafe6ae9ae380a33a02b7681c42ccadd76affcf936"}},{"ruleId":"D1","level":"warning","message":{"text":"tools.checkType (cyclomatic 21): tools.checkType has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/validate.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"eefde4dd3854273bc8dbf3330f27e55b41dcbaa0e4831d3af23c6759f9bd15f4"}},{"ruleId":"D1","level":"warning","message":{"text":"TavilySearchProvider.Search (cyclomatic 21): TavilySearchProvider.Search has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"711ce605c6da9474c72432fa98b0177033f8348809b1115dc1cace09afe6d2a1"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleInstallSkill (cyclomatic 21): Handler.handleInstallSkill has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"0835f2919dad58bdc8e0381ed46ad76ba2a1499d7a3ce67df1c2adc7f9052cb1"}},{"ruleId":"D1","level":"warning","message":{"text":"main.launcherConsoleHostsWithLocalAddrs (cyclomatic 21): main.launcherConsoleHostsWithLocalAddrs has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"003d2fa4edc1e8f9d8c102b9d0dd60260af1de30632ffcc350474f6f59b17d49"}},{"ruleId":"D1","level":"warning","message":{"text":"AgentLoop.ReloadProviderAndConfig (cyclomatic 20): AgentLoop.ReloadProviderAndConfig has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":376}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1e3ec06e5d91f635e387bcfa26b2665d87044d3165518dae17638855055042a"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.resolveMediaRefs (cyclomatic 20): agent.resolveMediaRefs has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_media.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8504227be8ea4e42ed4e8f9e6a4e2eec11db258d17c399ffa73a53c398a325a"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.transientLLMRetryReason (cyclomatic 20): agent.transientLLMRetryReason has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ef0ddb779513758ea999d01e111280a588cd6d159f1e1132c25e1780f7d8da"}},{"ruleId":"D1","level":"warning","message":{"text":"Pipeline.tryConfiguredStreamingLLM (cyclomatic 20): Pipeline.tryConfiguredStreamingLLM has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_streaming.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d641f976e01ca95341b4038f08f9aa52f91d738ea3083ad0164a6e734b9f213"}},{"ruleId":"D1","level":"warning","message":{"text":"tts.SynthesizeAndStore (cyclomatic 20): tts.SynthesizeAndStore has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/tts.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"078d188fe480aa482ee189458d7e796a0c2c775c86390ecad242e2aebcddabda"}},{"ruleId":"D1","level":"warning","message":{"text":"DiscordChannel.SendMedia (cyclomatic 20): DiscordChannel.SendMedia has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a7cce9087d0fa357ac6454cbd7be4ed3d3799d2ac6db7789a1eb7c3de98881f"}},{"ruleId":"D1","level":"warning","message":{"text":"MatrixChannel.SendMedia (cyclomatic 20): MatrixChannel.SendMedia has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/matrix/matrix.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"205ee139f9a4e123c1ac0ed01c1d4e29515b663c3b3ce629e53a2303609a474b"}},{"ruleId":"D1","level":"warning","message":{"text":"weixin.PerformLoginInteractive (cyclomatic 20): weixin.PerformLoginInteractive has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/auth.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc8fbc2e6233d61968ea3ff1d11b1481bc1035514723a08043c2ead9ab9e9439"}},{"ruleId":"D1","level":"warning","message":{"text":"WeixinChannel.resolveOutboundPart (cyclomatic 20): WeixinChannel.resolveOutboundPart has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":694}}}],"partialFingerprints":{"codehealthFindingId/v1":"956f47d24ea5d718ec074ed9d522cf98c3a5e6bdce51e6618460f946c3f209ba"}},{"ruleId":"D1","level":"warning","message":{"text":"config.migrateV1ToV2 (cyclomatic 20): config.migrateV1ToV2 has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2445b75f32f51fe8aaf84ccbfc3b7c7a2f423638628add3f5013019de147f8a"}},{"ruleId":"D1","level":"warning","message":{"text":"common.mergeGeminiSchemaMaps (cyclomatic 20): common.mergeGeminiSchemaMaps has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b86112eb486a2c9c67124652f71f3f79157876301d718d562e730a2b116ab27"}},{"ruleId":"D1","level":"warning","message":{"text":"GrepTool.Execute (cyclomatic 20): GrepTool.Execute has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/tool_grep.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"b31d42dc5bd5b75697aae53358e44d3b2892326604885cfdddc2b5dbca03bd06"}},{"ruleId":"D1","level":"warning","message":{"text":"CronTool.addJob (cyclomatic 20): CronTool.addJob has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/cron.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b9cc1239a8a5e58526a52ce68cb90fc9e159282e7f8126de3d6bab7e5d0d2bc"}},{"ruleId":"D1","level":"warning","message":{"text":"tools.encodeKeyToken (cyclomatic 20): tools.encodeKeyToken has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":960}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d0d3cbc4c76c374713f3b95c75c52a2365e2fd49e2db6e591cd0526e696461"}},{"ruleId":"D1","level":"warning","message":{"text":"BraveSearchProvider.Search (cyclomatic 20): BraveSearchProvider.Search has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b177e48ed6efa715266f51e44989447c8702f1f581df142b1d3f40fe0605386"}},{"ruleId":"D1","level":"warning","message":{"text":"SogouSearchProvider.Search (cyclomatic 20): SogouSearchProvider.Search has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":879}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c19205394846e04ee5d3de6ffcadd31c61a5df024b3791928dac3c04732796f"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecTool.runSync (cyclomatic 20): ExecTool.runSync has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"63c6f4d7e7648a516f0a868d6e55555694d1b8d00ce1eaff9634dc7d6914bd4a"}},{"ruleId":"D1","level":"warning","message":{"text":"api.sessionTranscriptMessages (cyclomatic 20): api.sessionTranscriptMessages has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a4f0217b10007443ecfb55e8bf0fa8aae87b5fd22ab83e4d1e361ebf84e09f6"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.lookupModelConfigByRef (cyclomatic 19): agent.lookupModelConfigByRef 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/model_resolution.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c115eaab081193cc721d3ceba742f27e3a2088a882375bf7cd0a896d1214a42"}},{"ruleId":"D1","level":"warning","message":{"text":"ContextBuilder.BuildMessagesFromPrompt (cyclomatic 19): ContextBuilder.BuildMessagesFromPrompt has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":842}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0496aed963e3fe99a0f8627cba6cbe89c167936aa66a703906598a637493875"}},{"ruleId":"D1","level":"warning","message":{"text":"tts.NewMimoTTSProvider (cyclomatic 19): tts.NewMimoTTSProvider has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/mimo_tts.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"77285bd4e09895f3a28ec561f86d0190bec6a8f6e5f2951902c46cfb88f6a801"}},{"ruleId":"D1","level":"warning","message":{"text":"FeishuChannel.Send (cyclomatic 19): FeishuChannel.Send has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"29650f4f873f72c17d5cc8c29e76341342aae552d8a1bbfc65f61a886749b764"}},{"ruleId":"D1","level":"warning","message":{"text":"SlackChannel.handleMessageEvent (cyclomatic 19): SlackChannel.handleMessageEvent has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack/slack.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a3ba78d32858238bf65c3da403a90f8c5af69b9f7e30b466fc06b89672ecb82"}},{"ruleId":"D1","level":"warning","message":{"text":"weixin.isDownloadableMediaItem (cyclomatic 19): weixin.isDownloadableMediaItem has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"2779054e1a322cba1aa361adf620fa2bb2ebb5999ec8b0c50dd1c28ee1a7beb7"}},{"ruleId":"D1","level":"warning","message":{"text":"WeixinChannel.downloadMediaFromItem (cyclomatic 19): WeixinChannel.downloadMediaFromItem has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eda339f8af343d46deeddb1421a33ca3f3a0ebdd6d3ed6c10fb97e8d68329c4"}},{"ruleId":"D1","level":"warning","message":{"text":"identity.MatchAllowed (cyclomatic 19): identity.MatchAllowed has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/identity/identity.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b05c4e19b411d60ff0c2d904d0d8507ac1b206a8d5169e742b5fd723fc1539c"}},{"ruleId":"D1","level":"warning","message":{"text":"KagiSearchProvider.Search (cyclomatic 19): KagiSearchProvider.Search has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"c10976cfd030fbad3360cd66069523996c07a6f49d3d9db675625c00dbed3980"}},{"ruleId":"D1","level":"warning","message":{"text":"WebSearchToolOptions.providerReady (cyclomatic 19): WebSearchToolOptions.providerReady has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1581}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f19eecd858d75fbd58cfd9f5055806b0d38f473ec91132f26e89b60fe7a527b"}},{"ruleId":"D1","level":"warning","message":{"text":"api.normalizeChannelArrayFields (cyclomatic 19): api.normalizeChannelArrayFields has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c73a9ed8cc8a2f70d946bd351f78c792766371eacbd49590016cb385bd0cbd8"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleTestInlineModel (cyclomatic 19): Handler.handleTestInlineModel has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":981}}}],"partialFingerprints":{"codehealthFindingId/v1":"4df4549e0045162982741cbd5e9ada97eefe11bf28223cd75382744322db923b"}},{"ruleId":"D1","level":"warning","message":{"text":"tts.NewOpenAITTSProviderWithOptions (cyclomatic 18): tts.NewOpenAITTSProviderWithOptions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/openai_tts.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"6940a4582e13e31473fd4647dd17f4307df655d8a40bd942640cb8e9c88f1919"}},{"ruleId":"D1","level":"warning","message":{"text":"LINEChannel.stripBotMention (cyclomatic 18): LINEChannel.stripBotMention has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/line.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"dda812f362fa7bf6c3fd4f3abe095ce53f5d73a18518a66579444d5a22f92981"}},{"ruleId":"D1","level":"warning","message":{"text":"qq.qqOggDuration (cyclomatic 18): qq.qqOggDuration has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/audio_duration.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"99d536cff1b81c08d46d85863ff568229093c4c9dd43130e58084514c6327cc7"}},{"ruleId":"D1","level":"warning","message":{"text":"config.migrateV0ToV1 (cyclomatic 18): config.migrateV0ToV1 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e8c13e78846b1df2c48781ad16fa8949e1332aa51a42f5bf70702ec9e3d587b"}},{"ruleId":"D1","level":"warning","message":{"text":"SkillRegistryConfig.UnmarshalJSON (cyclomatic 18): SkillRegistryConfig.UnmarshalJSON has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"a15bc673f9967c773c63608c5bc9d5dde5100c40bfff53d98a3451074a06d23a"}},{"ruleId":"D1","level":"warning","message":{"text":"cliprovider.NormalizeToolCall (cyclomatic 18): cliprovider.NormalizeToolCall has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/cli/toolcall_utils.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec4d575898722cae89ab536a2ddc2d75c6c49deb9fa41e81c655a40572954526"}},{"ruleId":"D1","level":"warning","message":{"text":"skills.parseGitHubTargetWithBaseURL (cyclomatic 18): skills.parseGitHubTargetWithBaseURL has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/installer.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"4886fe3c81d654526af156e68ff5e53c4971f8563f2b9dbe91b34fb8ea3c629d"}},{"ruleId":"D1","level":"warning","message":{"text":"tools.RunToolLoop (cyclomatic 18): tools.RunToolLoop has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/toolloop.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"0222f2e2c3c8fd50b2ae03eadb8413e9078cf609bcdc4b4418d638dda9f2e5ff"}},{"ruleId":"D1","level":"warning","message":{"text":"fstools.isBinaryReadFileData (cyclomatic 18): fstools.isBinaryReadFileData has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":714}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bbe922b1f32e36e167fe27e1d26db4b0336e5bff2aaaac204814cb2c4fe0436"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.findPicoJSONLSessions (cyclomatic 18): Handler.findPicoJSONLSessions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a6c7bf17ca75a1f322ff689a2df430b452cd4dc52cc52329fdcf22b171acd7"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handleListSessions (cyclomatic 18): Handler.handleListSessions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":820}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5836866eb7022605a76e656058770ed94670d9bfabd17947afa0cd778a7f0a9"}},{"ruleId":"D1","level":"warning","message":{"text":"auth.LoginBrowserWithOptions (cyclomatic 17): auth.LoginBrowserWithOptions has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/oauth.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"68152f59be47bed5d4cf1a71a65d7677c9415c1beaca2a0ecb6aab9fd2d7a713"}},{"ruleId":"D1","level":"warning","message":{"text":"BaseChannel.IsAllowed (cyclomatic 17): BaseChannel.IsAllowed has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/base.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"25854bc5e67fed3b42449e8c679ccfdc8de2d614f424e2f53df85cbde8293dba"}},{"ruleId":"D1","level":"warning","message":{"text":"DingTalkChannel.onChatBotMessageReceived (cyclomatic 17): DingTalkChannel.onChatBotMessageReceived has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/dingtalk/dingtalk.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"a96805fdfa1eef6e304e09e790d1263f224924ef91382be05a2a0f545b12b7d4"}},{"ruleId":"D1","level":"warning","message":{"text":"OneBotChannel.SendMedia (cyclomatic 17): OneBotChannel.SendMedia has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"a578af1b00d6a68179b1c4dfa013fc33435aef3785f540aac7e22bd9d5f9793d"}},{"ruleId":"D1","level":"warning","message":{"text":"PicoChannel.SendMedia (cyclomatic 17): PicoChannel.SendMedia has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b41b2890e3f887dde99d357b31ead923bad4709b7a26c80913393244589b0fa"}},{"ruleId":"D1","level":"warning","message":{"text":"SkillsRegistriesConfig.UnmarshalJSON (cyclomatic 17): SkillsRegistriesConfig.UnmarshalJSON has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef9bdcc569fec7ff0209b46527110f720a155477e44e9b0788c736c195311d5c"}},{"ruleId":"D1","level":"warning","message":{"text":"SkillRegistryConfig.UnmarshalYAML (cyclomatic 17): SkillRegistryConfig.UnmarshalYAML has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb9be27c98891552062a52fa82b08d7f5c380d6ec5e8bc9663754a2c39ccba47"}},{"ruleId":"D1","level":"warning","message":{"text":"LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cyclomatic 17): LLMPatternClusterer.validateAndBuildPatternsWithEvidence has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fcaba0f320c6fefbb2441628c4d238283e98234b2be1c45c5e30b4736fe9f3a"}},{"ruleId":"D1","level":"warning","message":{"text":"JSONLStore.ResolveSessionKey (cyclomatic 17): JSONLStore.ResolveSessionKey has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/jsonl.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1f78d94b742158c21fe0a5aa6bf41d106e2946bdc3874ac237a721560dc830f"}},{"ruleId":"D1","level":"warning","message":{"text":"netbind.probeHostForGroups (cyclomatic 17): netbind.probeHostForGroups has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/netbind/netbind.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e82acdad1f9b556f55a9e6dbbb5d7b35e67266ce3a053dee8526d6a544db4e6"}},{"ruleId":"D1","level":"warning","message":{"text":"Provider.Chat (cyclomatic 17): Provider.Chat has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/azure/provider.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ecbfcf4d23a9bae9f0751e7e71ef6ac5a4965a4c912c29e3aa2fd94bfcf4aa4"}},{"ruleId":"D1","level":"warning","message":{"text":"Provider.buildRequestBody (cyclomatic 17): Provider.buildRequestBody has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae2afad30a33b1a6d70d7e861064e7a5460c53767fdcf80030096a3920995e13"}},{"ruleId":"D1","level":"warning","message":{"text":"I2CTool.writeDevice (cyclomatic 17): I2CTool.writeDevice 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/i2c_linux.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"84bcd6517f561da57b34b01047e53958a2f4e14dfc7f80362c82642af0daeaba"}},{"ruleId":"D1","level":"warning","message":{"text":"MCPTool.normalizeResultContent (cyclomatic 17): MCPTool.normalizeResultContent has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/mcp_tool.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"eae06f4f047c142bda7e898abeda9371e4d8d94b3ab16983c53443da3dcfb106"}},{"ruleId":"D1","level":"warning","message":{"text":"PerplexitySearchProvider.Search (cyclomatic 17): PerplexitySearchProvider.Search has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1081}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4d8b54962578a691494a5a73f9a55822891bd09bce7341da792af50bc15ec89"}},{"ruleId":"D1","level":"warning","message":{"text":"utils.DownloadFile (cyclomatic 17): utils.DownloadFile has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/media.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"8819494ba8aae67affc8e1d2a4513d85caadcf962d7764b78dd0e9c2998a2621"}},{"ruleId":"D1","level":"warning","message":{"text":"api.modelConfigsMatchingSignatureRef (cyclomatic 17): api.modelConfigsMatchingSignatureRef 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a5d7454c1259cc7ec20d0ac55cfb524c1d95e99cdc0705bbc1775564741a507"}},{"ruleId":"D1","level":"warning","message":{"text":"api.normalizeStoredModelConfig (cyclomatic 17): api.normalizeStoredModelConfig 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"25a75bf1f5534d81a794b23c3f1de7e0b78ca5d3603ffdecbc4878049f84e571"}},{"ruleId":"D1","level":"warning","message":{"text":"mcp.buildServerConfig (cyclomatic 16): mcp.buildServerConfig has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/add.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4b8452e18347d2d234db3c795758fb07b133807864c883313cb816b71fd81a0"}},{"ruleId":"D1","level":"warning","message":{"text":"DiscordChannel.playTTS (cyclomatic 16): DiscordChannel.playTTS has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":883}}}],"partialFingerprints":{"codehealthFindingId/v1":"cee6757f3dd0eee583a5517a5d1ee29f4eeb645a93a7e03c2f201b7e81f6e26e"}},{"ruleId":"D1","level":"warning","message":{"text":"PicoChannel.Send (cyclomatic 16): PicoChannel.Send has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":298}}}],"partialFingerprints":{"codehealthFindingId/v1":"c69bb741548fe8984109e19731f3a38e76d34f3ce9a399eba5fe012ce19388d5"}},{"ruleId":"D1","level":"warning","message":{"text":"WeComChannel.storeRemoteMedia (cyclomatic 16): WeComChannel.storeRemoteMedia has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2848dc6ddf7855bdae5fcd3115be4e1d06ec568e765ded5a49b8ebff94d1579"}},{"ruleId":"D1","level":"warning","message":{"text":"WeComChannel.SendMedia (cyclomatic 16): WeComChannel.SendMedia has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"38e30c9ff3784fb8f0ebcde840ea77809123ddde1a87782a0090fb46a5dbbcde"}},{"ruleId":"D1","level":"warning","message":{"text":"WeComChannel.collectMixedMedia (cyclomatic 16): WeComChannel.collectMixedMedia has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a51bd638c0cf94b647f5baff6e18f85c74c8d82d886799a40a95e6e8d4a6863"}},{"ruleId":"D1","level":"warning","message":{"text":"config.loadSecurityConfig (cyclomatic 16): config.loadSecurityConfig has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2b9640cac1d6db4aaad75405f99b186d4b5117b3338a3ac45d0ba679190f06c"}},{"ruleId":"D1","level":"warning","message":{"text":"RawNode.UnmarshalJSON (cyclomatic 16): RawNode.UnmarshalJSON has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_channel.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"46959ba3f5528634d6530b81da155e559b8f70a44b6b5418a15620c2015c475d"}},{"ruleId":"D1","level":"warning","message":{"text":"USBMonitor.Start (cyclomatic 16): USBMonitor.Start has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/devices/sources/usb_linux.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"dba06764e84216ad9470b726b61d6f5f0a82d3ecdd1bded2a2071fbf3125bb61"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.MarkTaskRecordsClustered (cyclomatic 16): Store.MarkTaskRecordsClustered has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/store.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f732e025b18bbb5dd23738d0fc4dc0e3e46ecbf7204da6c3ff4d6e9057761d"}},{"ruleId":"D1","level":"warning","message":{"text":"mcp.connectServer (cyclomatic 16): mcp.connectServer has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/mcp/manager.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d9aea7650f449ebc8d428789f5bb0306c6fa40717987fb58a779df06b8be45"}},{"ruleId":"D1","level":"warning","message":{"text":"Provider.Chat (cyclomatic 16): Provider.Chat has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic_messages/provider.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"83a50f68f277405dae38d66b9ccc3f3038ec1c9ea0da82e96cef83b881bdf42d"}},{"ruleId":"D1","level":"warning","message":{"text":"CodexCliProvider.parseJSONLEvents (cyclomatic 16): CodexCliProvider.parseJSONLEvents has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/cli/codex_cli_provider.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"e42640c1570e669cd95d2a9a5ffa300b0d3e4ae019780a0c9aac27bd46cc5ca9"}},{"ruleId":"D1","level":"warning","message":{"text":"common.serializeToolCalls (cyclomatic 16): common.serializeToolCalls has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/common.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"476b1ab89a77d4c1f3d0092bb6bd89b1a358bc04335a0d98ece30af8627e7d6f"}},{"ruleId":"D1","level":"warning","message":{"text":"geminiSchemaSanitizer.sanitizeNode (cyclomatic 16): geminiSchemaSanitizer.sanitizeNode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b54e971a71ae62b9c4ad403ab9a4a1330df1da315a65f95f4f9ee64303a4013"}},{"ruleId":"D1","level":"warning","message":{"text":"seahorse.partsMatch (cyclomatic 16): seahorse.partsMatch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_engine.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9c094beb1f762e3657cd9c40afcaee5533bb3f89dea74f7f768048d4b82b3e4"}},{"ruleId":"D1","level":"warning","message":{"text":"session.buildSessionScope (cyclomatic 16): session.buildSessionScope has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/allocator.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6e12647ecd45a6f5af7cd62bea3f2cf91021a9a7d1f3a9cc3572e0f9b754167"}},{"ruleId":"D1","level":"warning","message":{"text":"GeminiSearchProvider.Search (cyclomatic 16): GeminiSearchProvider.Search has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"574db770424ff9d54954268667386280a851bc88fdd10cede346668a38ff2d2f"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handlePatchConfig (cyclomatic 16): Handler.handlePatchConfig has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"9df1d0513db326408fd4261b05b0463ee72a7dce1b88794ae5650e94823a7f73"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handlePollWecomFlow (cyclomatic 16): Handler.handlePollWecomFlow has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/wecom.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"683401e8070eed62c09b94fa8d7c0ede73e700aceb9872ab31e920270b3023b5"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.handlePollWeixinFlow (cyclomatic 16): Handler.handlePollWeixinFlow has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/weixin.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b778d9fd06451f7a97aa68b8b7aabc6a13513488b653d27a20a4f48be0f2401"}},{"ruleId":"D2","level":"warning","message":{"text":"Pipeline.ExecuteTools (cognitive 307): Pipeline.ExecuteTools has cognitive complexity 307 (threshold 15). Drivers by points: if/else 250, loops 21, boolean chains 19, match/switch 15, jumps 2 (nesting depth added 204). Of this number, 298 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"3328c9822bbd445f19670595a5f8f864c76275e8964256afc06c93c3819203b3"}},{"ruleId":"D2","level":"warning","message":{"text":"config.v0ProvidersMapToModelList (cognitive 230): config.v0ProvidersMapToModelList has cognitive complexity 230 (threshold 15). Drivers by points: if/else 123, boolean chains 101, loops 6 (nesting depth added 18). Of this number, 30 points are the body\u0027s own statements and 200 belong to 25 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"84386a6eaef47fe8854a2d8127a530efb0a8269004617176661bdf54668ca808"}},{"ruleId":"D2","level":"warning","message":{"text":"Pipeline.CallLLM (cognitive 152): Pipeline.CallLLM has cognitive complexity 152 (threshold 15). Drivers by points: if/else 116, boolean chains 21, loops 11, match/switch 4 (nesting depth added 63). Of this number, 124 points are the body\u0027s own statements and 28 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"164fd58c27c244770840d0b9b839f78aba96444698ba9e157b96f19999fb5e43"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.registerSharedTools (cognitive 103): agent.registerSharedTools has cognitive complexity 103 (threshold 15). Drivers by points: if/else 91, boolean chains 8, loops 4 (nesting depth added 56). Of this number, 62 points are the body\u0027s own statements and 41 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_init.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb0e7476fae1161fc62525c1dc8da254a91472aa51488e95a39e221f9e99acab"}},{"ruleId":"D2","level":"warning","message":{"text":"api.applySecureStringsToStruct (cognitive 100): api.applySecureStringsToStruct has cognitive complexity 100 (threshold 15). Drivers by points: if/else 84, loops 13, boolean chains 3 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":740}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf1fe0267e207942567eb965d609f336d56d1b99d3bc722a94c16c1ab252bacf"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecTool.runBackground (cognitive 91): ExecTool.runBackground has cognitive complexity 91 (threshold 15). Drivers by points: if/else 83, loops 6, boolean chains 2 (nesting depth added 50). Of this number, 20 points are the body\u0027s own statements and 71 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"c46d7c9b3eb53c05643420d86dd072e7f3361117a62020da8ef7f783ef15a396"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.preSend (cognitive 89): Manager.preSend has cognitive complexity 89 (threshold 15). Drivers by points: if/else 84, boolean chains 5 (nesting depth added 50). Of this number, 85 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bf1ad597b184ca0204e379752cada47305c1aabd5cd9e6575f4de3770d71140"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.runTurn (cognitive 88): AgentLoop.runTurn has cognitive complexity 88 (threshold 15). Drivers by points: if/else 72, match/switch 8, boolean chains 4, loops 4 (nesting depth added 47). Of this number, 84 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_coord.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"950d801d277bbedf5e6188aab381fe0c7ad6b99736a2b222f0caad7e5c394ecb"}},{"ruleId":"D2","level":"warning","message":{"text":"httpapi.parseGeminiStreamResponse (cognitive 84): httpapi.parseGeminiStreamResponse has cognitive complexity 84 (threshold 15). Drivers by points: if/else 76, loops 7, boolean chains 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebb891d12a04e42166a79045c7858f3fa167677e90aeb18a0a544124702d9211"}},{"ruleId":"D2","level":"warning","message":{"text":"converter.walk (cognitive 80): converter.walk has cognitive complexity 80 (threshold 15). Drivers by points: if/else 62, loops 12, boolean chains 4, match/switch 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/markdown.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d63d55ce40c3be4951b9a09ac08cf33e2c70385ec4fc0df091bd4f5d1d4b5b0"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.sanitizeHistoryForProvider (cognitive 79): agent.sanitizeHistoryForProvider has cognitive complexity 79 (threshold 15). Drivers by points: if/else 60, loops 14, boolean chains 3, match/switch 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"6df8eb4f0a1adf5b6a738d6e5812a13c02400d1fbee1a028084f99e963920059"}},{"ruleId":"D2","level":"warning","message":{"text":"providers.CreateProviderFromConfig (cognitive 79): providers.CreateProviderFromConfig has cognitive complexity 79 (threshold 15). Drivers by points: if/else 72, boolean chains 6, match/switch 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory_provider.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4e947cabfe61f4fa6464ad3ace1c46411fb6bf4c673c432449548aa4f37fb49"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 78): main.main has cognitive complexity 78 (threshold 15). Drivers by points: if/else 61, loops 6, match/switch 6, boolean chains 5 (nesting depth added 19). Of this number, 74 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"dce86f67dfc2b6613c5446715d095a4afdf55f4c155ecc4094e4286c8b17518b"}},{"ruleId":"D2","level":"warning","message":{"text":"CompactionEngine.compactCondensed (cognitive 75): CompactionEngine.compactCondensed has cognitive complexity 75 (threshold 15). Drivers by points: if/else 60, loops 9, boolean chains 6 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a622b15671ff06e1d2e86d81431a57ec91cad44ed09f47d27922a8ebdba51c5"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecTool.guardCommand (cognitive 74): ExecTool.guardCommand has cognitive complexity 74 (threshold 15). Drivers by points: if/else 59, loops 11, boolean chains 4 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":1152}}}],"partialFingerprints":{"codehealthFindingId/v1":"f38995ff97ba5e09c2d3bd0a24905f6efcb891abfaec53f27195593a37befd9b"}},{"ruleId":"D2","level":"warning","message":{"text":"anthropicmessages.buildRequestBody (cognitive 73): anthropicmessages.buildRequestBody has cognitive complexity 73 (threshold 15). Drivers by points: if/else 63, boolean chains 4, loops 4, match/switch 2 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic_messages/provider.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e2142160a9f252e1e9e368c9871dd95feb841c40858f1cd96f4f7ea5045b2cd"}},{"ruleId":"D2","level":"warning","message":{"text":"OneBotChannel.parseMessageSegments (cognitive 72): OneBotChannel.parseMessageSegments has cognitive complexity 72 (threshold 15). Drivers by points: if/else 65, boolean chains 4, match/switch 2, loops 1 (nesting depth added 44). Of this number, 69 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea4be0fe73f03e25c9e8dcb6187f9bc5a861557652338e9e62e873335779064c"}},{"ruleId":"D2","level":"warning","message":{"text":"config.loadConfigMap (cognitive 70): config.loadConfigMap has cognitive complexity 70 (threshold 15). Drivers by points: if/else 59, loops 10, boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"0150c45b5c208a42c61fa9ccc745d65f17da9d3ed925a9402627ee183230e62e"}},{"ruleId":"D2","level":"warning","message":{"text":"channels.SplitMessage (cognitive 69): channels.SplitMessage has cognitive complexity 69 (threshold 15). Drivers by points: if/else 63, boolean chains 3, loops 3 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/split.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"0084bab6c2c9b84ed1e372f3e87295f8bc97cc4862c3b6c87bdbe1816fd88012"}},{"ruleId":"D2","level":"warning","message":{"text":"Runtime.RunColdPathOnce (cognitive 69): Runtime.RunColdPathOnce has cognitive complexity 69 (threshold 15). Drivers by points: if/else 59, boolean chains 5, loops 3, match/switch 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee21f61ae16c951c592d659e9c0e0bc38a27afcfb18db053ab0c501f364cad31"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.ensureMCPInitialized (cognitive 68): AgentLoop.ensureMCPInitialized has cognitive complexity 68 (threshold 15). Drivers by points: if/else 52, loops 11, boolean chains 5 (nesting depth added 34). Most of this is not in the body itself: 9 of the 68 points are its own statements and the rest belongs to one function literal inside it that branches (line 109). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_mcp.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"b324f0e576496469ca45a9d18e72397430069aa0f61dd358605009893601dd35"}},{"ruleId":"D2","level":"warning","message":{"text":"anthropicprovider.buildParams (cognitive 67): anthropicprovider.buildParams has cognitive complexity 67 (threshold 15). Drivers by points: if/else 52, loops 9, boolean chains 4, match/switch 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic/provider.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"18463cc7a9d649c6c291c763ef13f1b90ce25297df288686d71932add3b345a6"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.Run (cognitive 66): AgentLoop.Run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 58, match/switch 5, boolean chains 2, loops 1 (nesting depth added 43). Of this number, 25 points are the body\u0027s own statements and 41 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"a84da8a05d99c30769ea8fff8b68801828a66cda7c9f4c72d738020e8fef8319"}},{"ruleId":"D2","level":"warning","message":{"text":"updater.findAssetInfo (cognitive 66): updater.findAssetInfo has cognitive complexity 66 (threshold 15). Drivers by points: if/else 50, loops 13, boolean chains 3 (nesting depth added 31). Of this number, 36 points are the body\u0027s own statements and 30 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/updater/updater.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9dcd26d229d8cef04b13d5cbf5cf764c3560649addf0b1758ef9fd8eb0489ab"}},{"ruleId":"D2","level":"warning","message":{"text":"WebSearchToolOptions.providerByName (cognitive 63): WebSearchToolOptions.providerByName has cognitive complexity 63 (threshold 15). Drivers by points: if/else 62, match/switch 1 (nesting depth added 31). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1655}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7000ca22b45c9697d1642ae0d4919c9e1611f75825ef1c1be57f959b2ad05d6"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.askSideQuestion (cognitive 62): AgentLoop.askSideQuestion has cognitive complexity 62 (threshold 15). Drivers by points: if/else 49, boolean chains 9, match/switch 4 (nesting depth added 19). Of this number, 49 points are the body\u0027s own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_coord.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4fe4616a8eac5e03019b9916dd8857534dcdd5f407af612165a3d9f094eee68"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateV1ToV2 (cognitive 62): config.migrateV1ToV2 has cognitive complexity 62 (threshold 15). Drivers by points: if/else 55, loops 7 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"83d73fd996c3596adf741eb9fb9ddd89f7629cda562ac614e3efd6451941ac91"}},{"ruleId":"D2","level":"warning","message":{"text":"OpenClawConfig.convertChannels (cognitive 62): OpenClawConfig.convertChannels has cognitive complexity 62 (threshold 15). Drivers by points: if/else 51, boolean chains 11 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/sources/openclaw/openclaw_config.go"},"region":{"startLine":773}}}],"partialFingerprints":{"codehealthFindingId/v1":"740ee220d6bd5b4befbb5509caea87d188f39199c0e0254d9d7be6f4a6d2eb38"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_compat.parseStreamResponse (cognitive 60): openai_compat.parseStreamResponse has cognitive complexity 60 (threshold 15). Drivers by points: if/else 56, loops 3, boolean chains 1 (nesting depth added 24). Of this number, 31 points are the body\u0027s own statements and 29 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3d8712a2650cf601bcf1ec85513246371719da2c9bb0fcfc7eaf7b8cecfe210"}},{"ruleId":"D2","level":"warning","message":{"text":"config.LoadConfig (cognitive 59): config.LoadConfig has cognitive complexity 59 (threshold 15). Drivers by points: if/else 57, boolean chains 1, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1293}}}],"partialFingerprints":{"codehealthFindingId/v1":"58485ea0552621d09f2ba1434772e4e5e110d7d9eb63f3fd5e46e0943cf84d73"}},{"ruleId":"D2","level":"warning","message":{"text":"Engine.Bootstrap (cognitive 59): Engine.Bootstrap has cognitive complexity 59 (threshold 15). Drivers by points: if/else 48, boolean chains 6, loops 5 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_engine.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"04bc32085e0672f10abed428a8d1f59220197d5b0c5b8a4b430bb6d5e3cfa757"}},{"ruleId":"D2","level":"warning","message":{"text":"api.validateConfig (cognitive 58): api.validateConfig has cognitive complexity 58 (threshold 15). Drivers by points: if/else 44, boolean chains 13, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8776c756d1d6df0145403b10740e43791d8892e9e3bb8eddeaa35ca62433fd0"}},{"ruleId":"D2","level":"warning","message":{"text":"GeminiProvider.buildRequestBody (cognitive 57): GeminiProvider.buildRequestBody has cognitive complexity 57 (threshold 15). Drivers by points: if/else 44, loops 9, boolean chains 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ef3b5660a3e6ccf1cca1efdd22e3dbe4c32153e8f598f905f8d410d23265905"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.buildCommandsRuntime (cognitive 56): AgentLoop.buildCommandsRuntime has cognitive complexity 56 (threshold 15). Drivers by points: if/else 47, loops 5, boolean chains 4 (nesting depth added 15). Most of this is not in the body itself: 5 of the 56 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 140, 299, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_command.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"29b70e991fd7e7ff07ddee715601aee08bf5bb1f9243d07373651a4fffa865d3"}},{"ruleId":"D2","level":"warning","message":{"text":"config.collectSensitive (cognitive 54): config.collectSensitive has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38, loops 12, boolean chains 3, match/switch 1 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"89915c124cc283d6fa3dbfdfe9e055a5fc46c312bc5d74f96f86462b39c1f685"}},{"ruleId":"D2","level":"warning","message":{"text":"api.sessionTranscriptMessages (cognitive 54): api.sessionTranscriptMessages has cognitive complexity 54 (threshold 15). Drivers by points: if/else 50, match/switch 2, boolean chains 1, loops 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"1166a1d7e7574daa686a29a81d0c1c77252681f65d734bb46fa1ef1163c5bd95"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.startGatewayLocked (cognitive 54): Handler.startGatewayLocked has cognitive complexity 54 (threshold 15). Drivers by points: if/else 50, boolean chains 3, loops 1 (nesting depth added 25). Most of this is not in the body itself: 13 of the 54 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1116, 1096). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":1008}}}],"partialFingerprints":{"codehealthFindingId/v1":"23442602b3a1ed058c762e75cbd0a52ade81495358b7dc8dc3bcecbb07326aaa"}},{"ruleId":"D2","level":"warning","message":{"text":"channels.hiddenValues (cognitive 53): channels.hiddenValues has cognitive complexity 53 (threshold 15). Drivers by points: if/else 42, loops 10, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager_channel.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"54cc57cd4a7b0ffcee575e821c8831261695b2d9f9db01a94b99c23b3f34854e"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.Send (cognitive 52): TelegramChannel.Send has cognitive complexity 52 (threshold 15). Drivers by points: if/else 44, boolean chains 4, loops 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"586999b9e39f51bf467f429b5eb9d802c5513850037b9a76f7dfa17e4188e7a1"}},{"ruleId":"D2","level":"warning","message":{"text":"evolution.buildFallbackPatternsWithEvidence (cognitive 52): evolution.buildFallbackPatternsWithEvidence has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33, loops 15, boolean chains 4 (nesting depth added 25). Of this number, 48 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"c37591e8108effcd9a99c92093b8ab5c553dccc2b115aa3f5fb5790806973563"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateV2ToV3 (cognitive 51): config.migrateV2ToV3 has cognitive complexity 51 (threshold 15). Drivers by points: if/else 43, loops 8 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"2570b121fb74ac57f8827d19c78ba712081f263214761fa081707cec2fafa3f1"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.appendEventContextFields (cognitive 50): agent.appendEventContextFields has cognitive complexity 50 (threshold 15). Drivers by points: if/else 47, loops 2, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_utils.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"fccbb58b12482046bbe52245713a1c120afd5dd490b972e859b9355b8a77fba6"}},{"ruleId":"D2","level":"warning","message":{"text":"Assembler.Assemble (cognitive 50): Assembler.Assemble has cognitive complexity 50 (threshold 15). Drivers by points: if/else 36, loops 11, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_assembler.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"e13d40237dbae9a32fb110f763564cc3fa46b43ea38df31934339c3deaf94b98"}},{"ruleId":"D2","level":"warning","message":{"text":"status.statusCmd (cognitive 48): status.statusCmd has cognitive complexity 48 (threshold 15). Drivers by points: if/else 34, loops 9, boolean chains 5 (nesting depth added 25). Most of this is not in the body itself: 15 of the 48 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 46, 59, 70, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/status/helpers.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d9b2a8b5b77b713beb7aded1a90a2ce40a9e23592d9fa2d6e6ea39b3728a5ee"}},{"ruleId":"D2","level":"warning","message":{"text":"main.EvalSeahorse (cognitive 47): main.EvalSeahorse has cognitive complexity 47 (threshold 15). Drivers by points: if/else 28, loops 18, boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"97fe3f47c4e974544d2711c6606997a6c567a97f0ce0828de84fdeee49802edc"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.pollLoop (cognitive 47): WeixinChannel.pollLoop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27, match/switch 16, loops 3, boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/weixin.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"434e3192bc91817dd17e18b09506ed62c597ea6d36be7ba44301eebfe8a1922b"}},{"ruleId":"D2","level":"warning","message":{"text":"ReadFileLinesTool.Execute (cognitive 47): ReadFileLinesTool.Execute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 36, boolean chains 8, loops 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":536}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcf6a6ea9724c446797dc4e2618bb9309599a60257ffc285c56ba4b8145adcbf"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateV0ToV1 (cognitive 46): config.migrateV0ToV1 has cognitive complexity 46 (threshold 15). Drivers by points: if/else 41, boolean chains 3, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"cac2f84a2095a980d4f41973ea38f956c1244c3dcb009dd4474baf3e91bf54d0"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.NewAgentInstance (cognitive 45): agent.NewAgentInstance has cognitive complexity 45 (threshold 15). Drivers by points: if/else 38, boolean chains 5, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/instance.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0f0c38b33b5202050e67828b2e881b4db8713e1baa670c0a505fc1223e62b51"}},{"ruleId":"D2","level":"warning","message":{"text":"tts.NewMimoTTSProvider (cognitive 44): tts.NewMimoTTSProvider has cognitive complexity 44 (threshold 15). Drivers by points: if/else 42, boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/mimo_tts.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d8271333d4f73b1d3e1ea795affacafe1d88a67d375a7bec9fb7ebc4b58f42f"}},{"ruleId":"D2","level":"warning","message":{"text":"WebFetchTool.Execute (cognitive 44): WebFetchTool.Execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 36, boolean chains 5, match/switch 3 (nesting depth added 12). Of this number, 42 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":2099}}}],"partialFingerprints":{"codehealthFindingId/v1":"109713231e14fed5f878659a0e1642b68bd3237770b76fcda4faae57ca319eb0"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.receiveVoice (cognitive 43): DiscordChannel.receiveVoice has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, match/switch 5, loops 2, boolean chains 1 (nesting depth added 24). Of this number, 35 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/voice.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"a30dbb2a286e4c21e583acc89dfa4d0fa9376bf453abd0c0a445d1e3c1c3446a"}},{"ruleId":"D2","level":"warning","message":{"text":"tts.NewOpenAITTSProviderWithOptions (cognitive 42): tts.NewOpenAITTSProviderWithOptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 40, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/openai_tts.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ec3bab4e8f204014085164be5beb584c3d6b1ec1b1bc40d8bef5683577a0916"}},{"ruleId":"D2","level":"warning","message":{"text":"slackwebhook.renderTable (cognitive 42): slackwebhook.renderTable has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24, loops 17, boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack_webhook/convert.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"686e0bdda4b45c0816c5aed2ca42c27d8063e6877c072088283c2cdd0542a01b"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.SendMedia (cognitive 41): TelegramChannel.SendMedia has cognitive complexity 41 (threshold 15). Drivers by points: if/else 34, boolean chains 4, match/switch 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac401f61212730f3fd8fe16f6a301fc23ab29a7a558ad70a0e5efe4134adb129"}},{"ruleId":"D2","level":"warning","message":{"text":"config.applyLegacySkillsSecurityNode (cognitive 41): config.applyLegacySkillsSecurityNode has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, boolean chains 6, loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fb49fd570b98b602b1fbd55ae6ac93ba59f6defd2ea572f3a5bc8e1c34c5882"}},{"ruleId":"D2","level":"warning","message":{"text":"gateway.Run (cognitive 41): gateway.Run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, loops 5, match/switch 3 (nesting depth added 12). Of this number, 36 points are the body\u0027s own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9b0c597208e423a28c4b7cca5e3711ba4bafb6cbc2426346b2b215c1ec8ca77"}},{"ruleId":"D2","level":"warning","message":{"text":"common.mergeGeminiSchemaMaps (cognitive 41): common.mergeGeminiSchemaMaps has cognitive complexity 41 (threshold 15). Drivers by points: if/else 34, loops 4, match/switch 2, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"d38af62919c09e932e3fd75b83564ca738beadc90755e93c1005a413d8c5d467"}},{"ruleId":"D2","level":"warning","message":{"text":"AntigravityProvider.buildRequest (cognitive 41): AntigravityProvider.buildRequest has cognitive complexity 41 (threshold 15). Drivers by points: if/else 30, loops 6, boolean chains 3, match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"4906e46c7807e4f00dd87a4ecbfba68f12bde283bb7ea48e5442798b074403ba"}},{"ruleId":"D2","level":"warning","message":{"text":"CompactionEngine.compactLeaf (cognitive 41): CompactionEngine.compactLeaf has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31, boolean chains 5, loops 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"d638f657b1f5ace3a1948d6f21d713adb42971fd10e49f6174ede51fd9a16927"}},{"ruleId":"D2","level":"warning","message":{"text":"api.normalizeChannelArrayFields (cognitive 41): api.normalizeChannelArrayFields has cognitive complexity 41 (threshold 15). Drivers by points: if/else 36, loops 3, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddb7261ed121a36da5cfe1229705a4eff2757ab8ad3453de8827041cf0b08cd4"}},{"ruleId":"D2","level":"warning","message":{"text":"api.canonicalizeSignatureValue (cognitive 41): api.canonicalizeSignatureValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, loops 6, match/switch 3 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"c276ead80038f142693d24d683accaa11543024f7ec9649ef03f88a6a343eb5b"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runEval (cognitive 40): main.runEval has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31, loops 6, match/switch 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/main.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"95ffc71c832c172dc23d122d7c2e1790fb5a6bf6bbb6afee1ec45ff1a0a6a681"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.resolveMediaRefs (cognitive 40): agent.resolveMediaRefs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, boolean chains 4, loops 3 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_media.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"75970cc2de807b789c28e15e4c9051de3c97faf77d91505163408afc75d321f7"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.StartAll (cognitive 40): Manager.StartAll has cognitive complexity 40 (threshold 15). Drivers by points: if/else 32, boolean chains 4, loops 4 (nesting depth added 19). Of this number, 24 points are the body\u0027s own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1214}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2968d402857fbf4938a0013d619b33b665fd68df1a39d18290487fb94f663b9"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.handleMessages (cognitive 40): TelegramChannel.handleMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 32, boolean chains 4, loops 4 (nesting depth added 11). Of this number, 35 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":1036}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7aada122cf62290f81b04203d381d7f40fa17e16a3104b8b40c6c5fec688076"}},{"ruleId":"D2","level":"warning","message":{"text":"DeltaChatChannel.handleMessage (cognitive 39): DeltaChatChannel.handleMessage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35, boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/handler.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad5c1ed8c1d0ab0a00d19f0cc2a85129be79c8345abfbe2d91fca0cfda7a0937"}},{"ruleId":"D2","level":"warning","message":{"text":"SogouSearchProvider.Search (cognitive 39): SogouSearchProvider.Search has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, loops 4, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":879}}}],"partialFingerprints":{"codehealthFindingId/v1":"de85de30aa96d98bf23882dad83a8f0ebc4e923eac98fce01d6714d08f3ad447"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecTool.executeRun (cognitive 39): ExecTool.executeRun has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, boolean chains 5, match/switch 1 (nesting depth added 13). Of this number, 38 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ae337ad7693f8369be0f17d215c744c6ab69a37ae6fb32a396a72bd3add4e67"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.runTTLJanitor (cognitive 38): Manager.runTTLJanitor has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, match/switch 2, boolean chains 1, loops 1 (nesting depth added 26). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1833, 1843, 1853, \u2026). 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\u0027 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1824}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d8dd3161cc94ef1a4bb56d036f75fe863f4cfe216eef64a083788e9a39726c5"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.resolveOutboundPart (cognitive 38): WeComChannel.resolveOutboundPart has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 2, match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b9ca98a5376257af68229193677c818ab0144d7f66ac5d4ccccc3606634952"}},{"ruleId":"D2","level":"warning","message":{"text":"netbind.BuildPlan (cognitive 37): netbind.BuildPlan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, match/switch 4, loops 3, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/netbind/netbind.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"eed877a9a3eb67cac0f74ccd206208d95f97cd01c26cb686db38c490e661fa5e"}},{"ruleId":"D2","level":"warning","message":{"text":"CodexProvider.Chat (cognitive 37): CodexProvider.Chat has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/codex_provider.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"57b3d9ef109a7c806579d78c895507328217b34732cb24ebabaad99ce5f9d63c"}},{"ruleId":"D2","level":"warning","message":{"text":"api.applyConfigSecretsFromMap (cognitive 37): api.applyConfigSecretsFromMap has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, loops 4, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d342eedfc84374005c519aeb2c33b430cdd87c9d00e865359dc970c08028bc7"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseChannel.HandleMessageWithContext (cognitive 36): BaseChannel.HandleMessageWithContext has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/base.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cfa0bda1c241917ecb19764fc1cae8249038eaec6638b117b6afc9495d74403"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.handleMessage (cognitive 36): DiscordChannel.handleMessage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 4, loops 3 (nesting depth added 9). Of this number, 33 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4e09d808576ea561a90f4a806953a77c0191c43c90c0a04e9da8a872ab387d8"}},{"ruleId":"D2","level":"warning","message":{"text":"LINEChannel.stripBotMention (cognitive 36): LINEChannel.stripBotMention has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28, boolean chains 3, match/switch 3, loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/line.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"f008f79e5242ca17ae0206c74001d90d1c42f1dd90e299c68fe680b36f855a51"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.RunToolLoop (cognitive 36): tools.RunToolLoop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23, loops 11, boolean chains 2 (nesting depth added 18). Of this number, 29 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/toolloop.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"97d7313cee45428b808b548d14143063924f6e4442a16235489d09808c3184a4"}},{"ruleId":"D2","level":"warning","message":{"text":"InstallSkillTool.Execute (cognitive 36): InstallSkillTool.Execute has cognitive complexity 36 (threshold 15). Drivers by points: if/else 36 (nesting depth added 9). Of this number, 33 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/skills_install.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c4be7e896b6b983236f859e141a7b38532d18c20970bf9a3cd82053de07229e"}},{"ruleId":"D2","level":"warning","message":{"text":"modelProbeCacheState.gc (cognitive 36): modelProbeCacheState.gc has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20, loops 10, boolean chains 6 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/model_status.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a0d7b6552a026b74d19a199aa20b7cb2d38b1da59dbe56c7f40b4ee2c743f41"}},{"ruleId":"D2","level":"warning","message":{"text":"LLMClient.Complete (cognitive 35): LLMClient.Complete has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 3, match/switch 3, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/llm_client.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"10944719f51f0f52a607b2bf44d5d1d1e623a6332655c19d2b5a49ec5fdc6725"}},{"ruleId":"D2","level":"warning","message":{"text":"audio.DecodeOggOpus (cognitive 35): audio.DecodeOggOpus has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, loops 3, boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/ogg.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"17c2e9ba194d10fd02e9662d4e33f5690cb99983524350e73a5b61199822aa77"}},{"ruleId":"D2","level":"warning","message":{"text":"SkillsRegistriesConfig.UnmarshalJSON (cognitive 35): SkillsRegistriesConfig.UnmarshalJSON has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25, loops 10 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"b95efcb754184339603cee32f0e7a205643a6f1bd23073301e2cb03b446b802c"}},{"ruleId":"D2","level":"warning","message":{"text":"skills.skillsListBuiltinCmd (cognitive 34): skills.skillsListBuiltinCmd has cognitive complexity 34 (threshold 15). Drivers by points: if/else 33, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/skills/helpers.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"901d9b3c7bd9beeb41cc9b6915752063e0653dd27370f53775e59b6fc75cdf65"}},{"ruleId":"D2","level":"warning","message":{"text":"Pipeline.SetupTurn (cognitive 34): Pipeline.SetupTurn has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, boolean chains 7 (nesting depth added 11). Of this number, 30 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_setup.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"0751ed9205dc2003047bf2f9811633558994de83628b3e0c9486ef8b2c93b16b"}},{"ruleId":"D2","level":"warning","message":{"text":"qq.qqWAVDuration (cognitive 34): qq.qqWAVDuration has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, match/switch 3, boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/audio_duration.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"f760e2306cc9b11825154686ca5db84a383d51cfa3ff6016be0ee73004da0bbb"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.SendMedia (cognitive 34): WeComChannel.SendMedia has cognitive complexity 34 (threshold 15). Drivers by points: if/else 33, loops 1 (nesting depth added 18). Of this number, 16 points are the body\u0027s own statements and 18 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"07f54573d3d13b79470e656941f7b1fafad3b79a5c7d44b9f3fbd9f5ab0c22b5"}},{"ruleId":"D2","level":"warning","message":{"text":"TavilySearchProvider.Search (cognitive 34): TavilySearchProvider.Search has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, loops 3, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b180c01994dcfbb3e4764f31504d5e2cc0d6c8965b6275524cb274011846176"}},{"ruleId":"D2","level":"warning","message":{"text":"LINEChannel.processEvent (cognitive 33): LINEChannel.processEvent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 30 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/line.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"436ef38360c631aa960bcd86f2108d8482617e1d9fba3519c9dfcc0d8d0a8fd7"}},{"ruleId":"D2","level":"warning","message":{"text":"LINEChannel.isBotMentioned (cognitive 33): LINEChannel.isBotMentioned has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, boolean chains 3, match/switch 3, loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/line.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a64f41a2eb05ea18e639831daaf748a2814903ec179058eb16c29faa0516371"}},{"ruleId":"D2","level":"warning","message":{"text":"AntigravityProvider.parseSSEResponse (cognitive 33): AntigravityProvider.parseSSEResponse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, loops 6 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8440472c5400534de31105ba5650d83e67ce190c19d69ac18edd12d7daad0bc"}},{"ruleId":"D2","level":"warning","message":{"text":"BraveSearchProvider.Search (cognitive 33): BraveSearchProvider.Search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 3, boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a358bae742166b3346f29aa3ee9bbee362fb6006aaeabb7687af18f8ccb16e3"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleUpdateModel (cognitive 33): Handler.handleUpdateModel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bea81d95e0549b187bf795fc84d720935ed9ae49dc1e69c282562b74dc86cb1"}},{"ruleId":"D2","level":"warning","message":{"text":"MatrixChannel.SendMedia (cognitive 32): MatrixChannel.SendMedia has cognitive complexity 32 (threshold 15). Drivers by points: if/else 31, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/matrix/matrix.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"0da3b5646da4ea51b9994bf729288b2d9cb5a57697daf9c42c627fbd3fcb6604"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.resolveOutboundPart (cognitive 32): WeixinChannel.resolveOutboundPart has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, boolean chains 2, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":694}}}],"partialFingerprints":{"codehealthFindingId/v1":"8975d739551b944f5ebcabac9c37884d936e86125f0ede6693f93fb2fd1685d8"}},{"ruleId":"D2","level":"warning","message":{"text":"skills.parseGitHubTargetWithBaseURL (cognitive 32): skills.parseGitHubTargetWithBaseURL has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 3, loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/installer.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"bad84b96357451d9167e66b4f5f85eba152a7c56251718621de5ded42e2c89bc"}},{"ruleId":"D2","level":"warning","message":{"text":"KagiSearchProvider.Search (cognitive 32): KagiSearchProvider.Search has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"30ebe9c235f28ab168af5c6fceaad8470770a559ab16c42eb8873e69062fdd97"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.authLogoutCmd (cognitive 31): auth.authLogoutCmd has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, loops 5, match/switch 4 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/helpers.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b2d8b7830446cbb0a42af3962ce9dc7a17e412e023663c739172407e1f61e92"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.inferSkillNamesFromToolCall (cognitive 31): agent.inferSkillNamesFromToolCall has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, boolean chains 6, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"edb4c16a4f0b65b4f915bd3a2deeff0596f3c1d5606c8cd60b204fbb26d32688"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.spawnSubTurn (cognitive 31): agent.spawnSubTurn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, match/switch 2, boolean chains 1 (nesting depth added 7). Of this number, 25 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/subturn.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"40ac8be555538cc769070a83882e74b9887bad1c9fcbdf8169e177af5ac0a426"}},{"ruleId":"D2","level":"warning","message":{"text":"feishu.extractImageKeysRecursive (cognitive 31): feishu.extractImageKeysRecursive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20, loops 4, match/switch 4, boolean chains 3 (nesting depth added 18). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/common.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa6de0b6b2e6bba61615dffebf356962c665c110d1ea58b6bd62de5b55f1d46e"}},{"ruleId":"D2","level":"warning","message":{"text":"qq.qqOggDuration (cognitive 31): qq.qqOggDuration has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, loops 6, boolean chains 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/audio_duration.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"258c5d1c7a622f2976d35e97bce2372a77c5c405650ad117feddfff72a9ae754"}},{"ruleId":"D2","level":"warning","message":{"text":"weixin.PerformLoginInteractive (cognitive 31): weixin.PerformLoginInteractive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, match/switch 5, boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/auth.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ed7713ce8553dbdd1bfb927ff2f8a62f9cdbcdcf3bea553579724135d98ee65"}},{"ruleId":"D2","level":"warning","message":{"text":"LLMPatternClusterer.validateAndBuildPatternsWithEvidence (cognitive 31): LLMPatternClusterer.validateAndBuildPatternsWithEvidence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, loops 5, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"924cb3ebdac8683a77e613d7518ced5b9a604032f4429fb3b3c50c00107ba907"}},{"ruleId":"D2","level":"warning","message":{"text":"RetrievalEngine.Grep (cognitive 31): RetrievalEngine.Grep has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, loops 4, boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_retrieval.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e53c094a0deab71fbc44aaeb79e1d4696c5b5d4f696b2b1ed0c1ed646d857ee"}},{"ruleId":"D2","level":"warning","message":{"text":"session.buildSessionScope (cognitive 31): session.buildSessionScope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, match/switch 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/allocator.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"83ddc2745646d3cd98de513942ace6f69d815052b445ca5aaadacc9f54769ca7"}},{"ruleId":"D2","level":"warning","message":{"text":"ReadFileTool.Execute (cognitive 31): ReadFileTool.Execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe86099622b83c0101f8decc4b8d2692aaa84d81d2d3cc1fb16c1075475a9d7f"}},{"ruleId":"D2","level":"warning","message":{"text":"MCPTool.normalizeResultContent (cognitive 31): MCPTool.normalizeResultContent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, match/switch 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/mcp_tool.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"59ee3b4001d93f9440e9fd0d71081bd71f00be4fe80259a16b5abaa59ebff523"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleTestInlineModel (cognitive 31): Handler.handleTestInlineModel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":981}}}],"partialFingerprints":{"codehealthFindingId/v1":"aab3d155a8102610ab2a966cac2246268a9a9d6b9d1530a39891cce5d97d1f7e"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.parseAddArgs (cognitive 30): mcp.parseAddArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, boolean chains 6, match/switch 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/add.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d36f30e2c636d6ca37af133f1ed799c665f5b674de56140c878ccab35356f0c"}},{"ruleId":"D2","level":"warning","message":{"text":"Pipeline.tryConfiguredStreamingLLM (cognitive 30): Pipeline.tryConfiguredStreamingLLM has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 4 (nesting depth added 10). Of this number, 24 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_streaming.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e7cdb964e171d3dfdee65851f11b20137b4888771e7a64ed2aa46346dcb91bb"}},{"ruleId":"D2","level":"warning","message":{"text":"DeltaChatChannel.ensureAccount (cognitive 30): DeltaChatChannel.ensureAccount has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/deltachat.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"49e03ae8212451b53821f319bf9cda0b42b20107b04114abb09d1f7556f36ade"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.SendMedia (cognitive 30): DiscordChannel.SendMedia has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 5, boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 29 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"08678a9b8cc1a212811348f91c517406e7cfaaea83ff1e4ee3301465630d5fdb"}},{"ruleId":"D2","level":"warning","message":{"text":"FeishuChannel.Send (cognitive 30): FeishuChannel.Send has cognitive complexity 30 (threshold 15). Drivers by points: if/else 30 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"0834e13841c91d78554b64e0857563cd0de07a320e7cac2035499cd1d1ca2e8a"}},{"ruleId":"D2","level":"warning","message":{"text":"OneBotChannel.listen (cognitive 30): OneBotChannel.listen has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, match/switch 7, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"363d724622d378fc9538e08ff067a391790fc033f3f394d7bffc836bb80b6fd6"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.NewExecToolWithConfig (cognitive 30): tools.NewExecToolWithConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 6, boolean chains 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"802550af057acb1f7ffac60cc358d94b6ee41f2d6847491f64b1eaf8ddbeb550"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.encodeKeyToken (cognitive 30): tools.encodeKeyToken has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":960}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d7f978f3a7be6ecd320ddafe9084565fc87f5bb9056cc8fa52be57731c56e18"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.runWorker (cognitive 29): Manager.runWorker has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 9, match/switch 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1461}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1f3df4c95cc6e93458de71352052ba6bb1cbeafc02ea99379fb9989dd4a66a7"}},{"ruleId":"D2","level":"warning","message":{"text":"MigrateInstance.Execute (cognitive 29): MigrateInstance.Execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/migrate.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc19cf1c626e0d5cd496b52056ea0f78a5b638a3f63740a24e7f303a00c342ae"}},{"ruleId":"D2","level":"warning","message":{"text":"FallbackChain.ExecuteCandidate (cognitive 29): FallbackChain.ExecuteCandidate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/fallback.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c1680c675696a99392f71834724dbf932c36f4708ca2c4f50fde68a5b9bad96"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecTool.runSync (cognitive 29): ExecTool.runSync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 3 (nesting depth added 9). Of this number, 28 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"25af0d11f6cfb4e3012ff047f7991aa830c5b39adabb3a4225d9de39fa1dcf0f"}},{"ruleId":"D2","level":"warning","message":{"text":"SpawnStatusTool.Execute (cognitive 29): SpawnStatusTool.Execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 5, loops 4 (nesting depth added 7). Of this number, 28 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/spawn_status.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4e0841c57b4b88801adcce7816e6a027298715a9dfe399689a4c6a72d469508"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleSearchSkills (cognitive 29): Handler.handleSearchSkills has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe0f54208b663d13a447252b59728061fb40e8b64cc82f9d0b0defc77994041e"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleUpdateWebSearchConfig (cognitive 29): Handler.handleUpdateWebSearchConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"c25b727d69e91477ba1bafce8eb74c42e76c225e4672bcd0c5765f9dcac4ad99"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.authLoginPasteToken (cognitive 28): auth.authLoginPasteToken has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 6, match/switch 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/helpers.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"f359a794ed016e13d680edd46e4c71c0af6ee3670884616f790f3d1404b263ea"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.normalizeProcessOptions (cognitive 28): agent.normalizeProcessOptions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/dispatch_request.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b79d1115484f9952c798ceccff48e10deca3137eba37edd04233a55a6240370"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.handleVoiceCommand (cognitive 28): DiscordChannel.handleVoiceCommand has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/voice.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eb38a3853b1458a52b7cb6574bad56523bcdcc519e6daa985c77f05de38c351"}},{"ruleId":"D2","level":"warning","message":{"text":"MatrixChannel.handleMessageEvent (cognitive 28): MatrixChannel.handleMessageEvent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/matrix/matrix.go"},"region":{"startLine":772}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c0762487cc18b830028589529b72937537365b54cfff5f6c5799f9914315d36"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.handleInboundMessage (cognitive 28): WeixinChannel.handleInboundMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 4, match/switch 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/weixin.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d9f2b2b51f5482b11e57d3658aa4df666ba34d249006ebe2cea77d9e482319a"}},{"ruleId":"D2","level":"warning","message":{"text":"config.applySkillsRegistryEnvCompat (cognitive 28): config.applySkillsRegistryEnvCompat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1554}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b60f62bda6dca8864e8ab81ca3d3d20ac4c442a56110a2b5ebc5289a3cea44f"}},{"ruleId":"D2","level":"warning","message":{"text":"fstools.validatePathWithAllowPaths (cognitive 28): fstools.validatePathWithAllowPaths has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6b606231e615f814c503746bf48310d7d67be2787df275b01d15662252c3adf"}},{"ruleId":"D2","level":"warning","message":{"text":"api.computeConfigSignature (cognitive 28): api.computeConfigSignature has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"52f31e34cb40a0a672accabfd3e33068666fce17af57081f6a8091d9a8aa7893"}},{"ruleId":"D2","level":"warning","message":{"text":"ContextBuilder.BuildMessagesFromPrompt (cognitive 27): ContextBuilder.BuildMessagesFromPrompt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":842}}}],"partialFingerprints":{"codehealthFindingId/v1":"30f0cc8d8895aff5ad57b93044345aefdd4d3bfe978c3307a9666d086be71135"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.downloadMediaFromItem (cognitive 27): WeixinChannel.downloadMediaFromItem has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 25 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0f9a09bf05f2edb353439be77bb7a2184c4f9e5d20c1212af0d1bc8e7162a04"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.connectServer (cognitive 27): mcp.connectServer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/mcp/manager.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fd51a489160648da6f6be6d77526bf701cae580d5003262c8e4d291167801e5"}},{"ruleId":"D2","level":"warning","message":{"text":"geminiSchemaSanitizer.mergeUnionBranches (cognitive 27): geminiSchemaSanitizer.mergeUnionBranches has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 5, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef806b2f8ac1113c780572b050b00d6f563a7d8c3c5da095e3156bc6767e2a39"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.IsPrivateOrRestrictedIP (cognitive 27): utils.IsPrivateOrRestrictedIP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, boolean chains 13 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/http_guard.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"837b32910c52519f669a7beb51e0595b9aab803da3e29f9d41ae317d92913ceb"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleListSessions (cognitive 27): Handler.handleListSessions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":820}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c476083b1d4acee471aa2ab1625a052a65d462cc1de02bd2d862284f96cdca4"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.playTTS (cognitive 26): DiscordChannel.playTTS has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, match/switch 7, loops 1 (nesting depth added 12). Of this number, 19 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":883}}}],"partialFingerprints":{"codehealthFindingId/v1":"b92fcef07907b554a967c00928f1500f258d1a42deec3f0c9c337351bdc6e2e0"}},{"ruleId":"D2","level":"warning","message":{"text":"OneBotChannel.handleMessage (cognitive 26): OneBotChannel.handleMessage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 2, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":931}}}],"partialFingerprints":{"codehealthFindingId/v1":"50b69f70a8cd56161ec09eb0aed081c30ca1f0e8eb2c1e496a6a1fb0553ab144"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.collectMixedMedia (cognitive 26): WeComChannel.collectMixedMedia has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 4, match/switch 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cad362a1b3d46aebcf786a32c7be5bd4ece112e160e73a1e6b9ddac6104f8bf"}},{"ruleId":"D2","level":"warning","message":{"text":"config.mergeModelListsWithMap (cognitive 26): config.mergeModelListsWithMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"32a68217b072a29fca37815739aa75d79d67ef434f43b301b4cd6bcd77bd347f"}},{"ruleId":"D2","level":"warning","message":{"text":"USBMonitor.Start (cognitive 26): USBMonitor.Start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, match/switch 5, boolean chains 2, loops 1 (nesting depth added 13). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/devices/sources/usb_linux.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6df19643f248d1d81158eae425c2758e674c3e7abe27481590abe3917a5e69d"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.MigrateFromJSON (cognitive 26): memory.MigrateFromJSON has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/migration.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb8563a7d92f3c4c8a3563972ff0f654d1f3b05002df9cfea3e40919c8b324e3"}},{"ruleId":"D2","level":"warning","message":{"text":"FallbackChain.ExecuteImage (cognitive 26): FallbackChain.ExecuteImage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/fallback.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1ed403c4d272f70180c69f1484a2eff2a2d938ce2584747f6002d49aa3e93d8"}},{"ruleId":"D2","level":"warning","message":{"text":"cliui.printMCPShowFancy (cognitive 25): cliui.printMCPShowFancy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/mcp_show.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"0121d1a96130493006c75e302a3062e5167fa5577b0f944086b025e8f1406605"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.ReloadProviderAndConfig (cognitive 25): AgentLoop.ReloadProviderAndConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, loops 1 (nesting depth added 6). Of this number, 24 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":376}}}],"partialFingerprints":{"codehealthFindingId/v1":"32bc496e29d09d5c4563585538b000089a4f5e4bf417c2a4a1e7ce431f9316a6"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.resolveActiveModelConfig (cognitive 25): agent.resolveActiveModelConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 5, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/model_resolution.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8be67f1730b217e8406805d3c4efab063641db531c144bfd9ef8f1000bd799c"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.uploadBufferToCDN (cognitive 25): WeixinChannel.uploadBufferToCDN has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, loops 1 (nesting depth added 11). Of this number, 15 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":834}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6452015e9d3f5397f67497a495bde3c10da7f397226cdefaacb39b23b20db94"}},{"ruleId":"D2","level":"warning","message":{"text":"SkillRegistryConfig.UnmarshalJSON (cognitive 25): SkillRegistryConfig.UnmarshalJSON has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"c163513fc1ebe6ca4f5c607b98b7a36c40b243eede98c2ef087d0b8132dfecc6"}},{"ruleId":"D2","level":"warning","message":{"text":"FileMediaStore.CleanExpired (cognitive 25): FileMediaStore.CleanExpired has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, loops 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/media/store.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff40cff0c41a473fa8daa3a8b80aafc665aa4f754f9d3d4a845a8932b7791805"}},{"ruleId":"D2","level":"warning","message":{"text":"common.geminiSchemaBranchType (cognitive 25): common.geminiSchemaBranchType has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 2, boolean chains 1, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":425}}}],"partialFingerprints":{"codehealthFindingId/v1":"07e17ec29f59e008f10fd3e57e381a3bb97a76310b1bb7d97cbaad73988e3f81"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_responses_common.TranslateMessages (cognitive 25): openai_responses_common.TranslateMessages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 5, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_responses_common/responses_common.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"324dbf1eaf8686fd89c4a073816f44d9ac293b674fdea602b5d392820366a063"}},{"ruleId":"D2","level":"warning","message":{"text":"PerplexitySearchProvider.Search (cognitive 25): PerplexitySearchProvider.Search has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1081}}}],"partialFingerprints":{"codehealthFindingId/v1":"580801542f745b0384a50e5d0b61845627e5605ce8b4e6484d3dd23e4e9a4186"}},{"ruleId":"D2","level":"warning","message":{"text":"updater.extractTarFromReader (cognitive 25): updater.extractTarFromReader has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, match/switch 2, boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/updater/updater.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7cf962fbf800d24208468f67582265c22db3afa08e31fe14ff2b80024f582f6"}},{"ruleId":"D2","level":"warning","message":{"text":"api.normalizeStoredModelConfig (cognitive 25): api.normalizeStoredModelConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbf8efc1c88af3136ce1b0df50d4144b77c026c285c2da0aa7cced12d30b23d2"}},{"ruleId":"D2","level":"warning","message":{"text":"cliui.printMCPShowPlain (cognitive 24): cliui.printMCPShowPlain has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/mcp_show.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"887dc72b777c2a6674417f3ae5f39ca6666797897b086e544fcd6379c3e9fc0c"}},{"ruleId":"D2","level":"warning","message":{"text":"feishu.extractPostImageKeys (cognitive 24): feishu.extractPostImageKeys has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (nesting depth added 12). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 83). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/common.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0acfc9de95d294267a0ff882eccee3039d4c3fb19e713e433fddded87e2a03e"}},{"ruleId":"D2","level":"warning","message":{"text":"PicoChannel.SendMedia (cognitive 24): PicoChannel.SendMedia has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"c46498428e24ae9ee7c208051e8ce67db6ffe41d3e16f30b658ce15dd803e943"}},{"ruleId":"D2","level":"warning","message":{"text":"JSONLStore.ResolveSessionKey (cognitive 24): JSONLStore.ResolveSessionKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/jsonl.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"78d1a2d4d21fc05d24f1f9440ebe7992eeaec12ac77a1247e8b0f86037c7a397"}},{"ruleId":"D2","level":"warning","message":{"text":"common.serializeToolCalls (cognitive 24): common.serializeToolCalls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/common.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"146625b461e66b5971f96df3b12f8f97a8d6f91d7ed89d26325893991a6998d1"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleGetSession (cognitive 24): Handler.handleGetSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"56a676a469dd96b00d032c40ebb5893cf2729b47149f694f1c0f08b251ed6177"}},{"ruleId":"D2","level":"warning","message":{"text":"main.launcherConsoleHostsWithLocalAddrs (cognitive 24): main.launcherConsoleHostsWithLocalAddrs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, match/switch 4, boolean chains 2, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"1187c2112b95f32fb60aa465f248bb811463cade137c837fe0c25ae15fd4e4db"}},{"ruleId":"D2","level":"warning","message":{"text":"model.pickModel (cognitive 23): model.pickModel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/model/add.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"207dbd6d5b376f6582419060f9bde0ea943dd0ff7ab9cdc278f51c6c6f339da1"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.skillFilesChangedSince (cognitive 23): agent.skillFilesChangedSince has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, loops 2, boolean chains 1 (nesting depth added 10). Of this number, 14 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":688}}}],"partialFingerprints":{"codehealthFindingId/v1":"33cd5c9db8fb17dffb337935cf4192aa8a13e91b120d9a1484769433eede4d0d"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.lookupModelConfigByRef (cognitive 23): agent.lookupModelConfigByRef has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/model_resolution.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"e07df460bf195f51d0ef6d40ad0406025f7e149235ef6fda388bc057de2bc98f"}},{"ruleId":"D2","level":"warning","message":{"text":"audio.SplitSentences (cognitive 23): audio.SplitSentences has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 4 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/sentence.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"42bae8cf5f897dfcdc77d28e584b8f827102e4d7aa5b8def06f3f60d2822b2c9"}},{"ruleId":"D2","level":"warning","message":{"text":"SlackChannel.handleMessageEvent (cognitive 23): SlackChannel.handleMessageEvent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 2 (nesting depth added 5). Of this number, 20 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack/slack.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"227390271c6fe416382be0f367a473bf1776aeb380d8c5fb2b33cd1c1c2f8357"}},{"ruleId":"D2","level":"warning","message":{"text":"TeamsWebhookChannel.buildAdaptiveCard (cognitive 23): TeamsWebhookChannel.buildAdaptiveCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/teams_webhook/teams_webhook.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbda0fab7c315447140b83dbed2b71c331f5b05888b12f4d2dd6bda08a81a14c"}},{"ruleId":"D2","level":"warning","message":{"text":"commands.showMCPToolsHandler (cognitive 23): commands.showMCPToolsHandler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 47). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/commands/handler_mcp.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff36a1e3964c6d506d0fb1e310e7a8560b21debbfb641ba1c0f8c50349ffeec5"}},{"ruleId":"D2","level":"warning","message":{"text":"config.loadSecurityConfig (cognitive 23): config.loadSecurityConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f8ea0ebfdf955f5de6d51b0efe3a61e6842fece9edaf7fb426734ea1e865af7"}},{"ruleId":"D2","level":"warning","message":{"text":"SkillRegistryConfig.UnmarshalYAML (cognitive 23): SkillRegistryConfig.UnmarshalYAML has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"69227459e26a1b76cae566e163af4fdd30f6030b1b3be900d6d7fd61e7993498"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.MarkTaskRecordsClustered (cognitive 23): Store.MarkTaskRecordsClustered has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/store.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7f135c9eac2f51fc8f30a75eccf5ee7ac2daf3a79f5f2af52771fe0f6a37ae4"}},{"ruleId":"D2","level":"warning","message":{"text":"gateway.setupConfigWatcherPolling (cognitive 23): gateway.setupConfigWatcherPolling has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, match/switch 6, boolean chains 1, loops 1 (nesting depth added 15). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 760). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":754}}}],"partialFingerprints":{"codehealthFindingId/v1":"0066c6eb281a3cc6eea0201757e4bd2b36c80ac4eddcff7fce96e165b5555e3a"}},{"ruleId":"D2","level":"warning","message":{"text":"common.ParseResponse (cognitive 23): common.ParseResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/common.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"62eb752741474af21738a5048fe606cb8987b548155e79a59e49501a4c1b163b"}},{"ruleId":"D2","level":"warning","message":{"text":"geminiSchemaSanitizer.sanitizeNode (cognitive 23): geminiSchemaSanitizer.sanitizeNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1e82e9ec3b3d2c15a9e1d366c64f4f00a367e10200a1c59d0840b09fd8865ce"}},{"ruleId":"D2","level":"warning","message":{"text":"Provider.buildRequestBody (cognitive 23): Provider.buildRequestBody has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eef8806fbdac2ffccb5e58ca81378fb86bc65c6f4ce4c72c8246c6ffd226ae5"}},{"ruleId":"D2","level":"warning","message":{"text":"GitHubRegistry.Search (cognitive 23): GitHubRegistry.Search has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 4, loops 2 (nesting depth added 2). Of this number, 22 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/github_registry.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"39b507be04f4505d8ee698bc90f337a6cce94b364f05e8da2697de718f52ae81"}},{"ruleId":"D2","level":"warning","message":{"text":"CronTool.addJob (cognitive 23): CronTool.addJob has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 7 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/cron.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"bff679ac6f27d60d634a63ff82ed16d93828e8303c259481b189f5b812ce6626"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.checkType (cognitive 23): tools.checkType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, match/switch 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/validate.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"657eb7a0b52933bd3e336779a391ad2edd82d9d5ab2bb6123563d1a96f951450"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.findPicoJSONLSessions (cognitive 23): Handler.findPicoJSONLSessions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"69525fcd7fab742678e8a4a5f5fda9ec39cf9d7a668700ef85ab90888dc43530"}},{"ruleId":"D2","level":"warning","message":{"text":"main.onReady (cognitive 23): main.onReady has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, match/switch 2, loops 1 (nesting depth added 13). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 45). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/systray.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"af81ce7227ca89ed11053599b27e70650e59aa379cf1269c3c90b7ca6b4825be"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.pollWeComQRCodeResult (cognitive 22): auth.pollWeComQRCodeResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, match/switch 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/wecom.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ee60591a589bef160db847c4b0d611299903abce7c885b72b2c362e8f20a7e8"}},{"ruleId":"D2","level":"warning","message":{"text":"DingTalkChannel.onChatBotMessageReceived (cognitive 22): DingTalkChannel.onChatBotMessageReceived has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/dingtalk/dingtalk.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"152ac5904857cb5fd91ac1c81cacb7882c2aedc7c671e026b38a00c119395075"}},{"ruleId":"D2","level":"warning","message":{"text":"FeishuChannel.handleMessageReceive (cognitive 22): FeishuChannel.handleMessageReceive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":583}}}],"partialFingerprints":{"codehealthFindingId/v1":"49cfaf5a588abfcaacd6d6596a8cdae1756ddd5237e3a1419aadcf6fed173104"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.collectTelegramMessageParts (cognitive 22): TelegramChannel.collectTelegramMessageParts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":1213}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe95c9bd0a6eaae20a0826eb2ada770fb01c01f8d8a7ab909282b04e1214e5d0"}},{"ruleId":"D2","level":"warning","message":{"text":"wecom.detectWeComMediaMetadata (cognitive 22): wecom.detectWeComMediaMetadata has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 8, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"6960fdaee4bab890557125faf80ef76a23b25fff87d4c7aa54f2a25c8955bea2"}},{"ruleId":"D2","level":"warning","message":{"text":"cliprovider.NormalizeToolCall (cognitive 22): cliprovider.NormalizeToolCall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/cli/toolcall_utils.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bf0045e3023c305663958d1165021d56c2c222a7d9605b8602613476b662572"}},{"ruleId":"D2","level":"warning","message":{"text":"common.mergeUnionObjectSchemas (cognitive 22): common.mergeUnionObjectSchemas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, loops 10 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/google_schema.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"999027e509b02ff14b02f9286fd59f6e0ddac1f0feb0ca91e96edf061a3c73a5"}},{"ruleId":"D2","level":"warning","message":{"text":"updater.extractZip (cognitive 22): updater.extractZip has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/updater/updater.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a8d69b7d2df4328f18c722b8e660058f85dcc0148d6564a2861e1f3d823ba42"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.DownloadFile (cognitive 22): utils.DownloadFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/media.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6b057cde0f1cc8e8d1c2e422c8ccb4b612f07a00f31cb1a6666fc96137ec177"}},{"ruleId":"D2","level":"warning","message":{"text":"api.buildToolSupport (cognitive 22): api.buildToolSupport has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, match/switch 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"885110b9d11808c31c02755d50f8dfaca076efb72ef1442e043e7d7ce17a5c94"}},{"ruleId":"D2","level":"warning","message":{"text":"main.buildSeahorseContext (cognitive 21): main.buildSeahorseContext has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 7, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval_llm.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"78fed6a783dd3f0a92156396d89623fa6470847356014c0ebcc7c4f4b53ffd1f"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.authStatusCmd (cognitive 21): auth.authStatusCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/helpers.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc96eb689c5bb5000fcfed61ef6afad3c4c06eada3f29c7a8b600862c3f9e1e6"}},{"ruleId":"D2","level":"warning","message":{"text":"cliui.FormatCLIError (cognitive 21): cliui.FormatCLIError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/help_error.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"358bd8792d98df9b0802c9aff23f6c21f2a855580bc0348f10762655b75ac1d7"}},{"ruleId":"D2","level":"warning","message":{"text":"channels.dispatchLoop (cognitive 21): channels.dispatchLoop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, match/switch 2, boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1627}}}],"partialFingerprints":{"codehealthFindingId/v1":"15b83470ef096e2e32c24590721bd95f66c993edc43283cfed564bee66f4fa23"}},{"ruleId":"D2","level":"warning","message":{"text":"FeishuChannel.downloadInboundMedia (cognitive 21): FeishuChannel.downloadInboundMedia has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 3 (nesting depth added 11). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":808}}}],"partialFingerprints":{"codehealthFindingId/v1":"138acb0c4d1a2a0963f8468cbd39f4203bd1248a729a5348bb1b4245f59ff288"}},{"ruleId":"D2","level":"warning","message":{"text":"splitMarkerStreamer.finalizeCompletedPartsLocked (cognitive 21): splitMarkerStreamer.finalizeCompletedPartsLocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":823}}}],"partialFingerprints":{"codehealthFindingId/v1":"a731eaf212510ef39ca0d15b11fc939e800ffa94357fb8aeea5eb19657e5b3b7"}},{"ruleId":"D2","level":"warning","message":{"text":"CronService.executeJobByID (cognitive 21): CronService.executeJobByID has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/cron/service.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e9de8139d85a9e699b7b712b5b1d6c4f649a4dfe30d72e2b3676cb955b9dfde"}},{"ruleId":"D2","level":"warning","message":{"text":"netbind.DetectIPFamilies (cognitive 21): netbind.DetectIPFamilies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 78). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/netbind/netbind.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6fb1db78bbb8af65251a8745f090373596119ece094d81e41d961d5b1f126f4"}},{"ruleId":"D2","level":"warning","message":{"text":"seahorse.partsMatch (cognitive 21): seahorse.partsMatch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, match/switch 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_engine.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7f4d0dd2e569478286d7ae6d7b4508d326346714799106c8ce8191c951054b3"}},{"ruleId":"D2","level":"warning","message":{"text":"GrepTool.Execute (cognitive 21): GrepTool.Execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/tool_grep.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"9572c23651bf5a734cbbbd9b7ea3f6cf38d5a092a0bd12f638352aebc1c24abb"}},{"ruleId":"D2","level":"warning","message":{"text":"MessageTool.buildMediaParts (cognitive 21): MessageTool.buildMediaParts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/message.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"4914c02253428cacf798d67465f9cd336c382846ed6799a5859e060753957b10"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.TruncateContextSmart (cognitive 21): utils.TruncateContextSmart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 6 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/context.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfb1c6e9f60d5b2d137a413d8189aea439abb08e91bdaceb0351a4bc4cd42137"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.DoRequestWithRetry (cognitive 21): utils.DoRequestWithRetry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/http_retry.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"7569cca43f7e47ec17510dba8601be186c7982e929b875f75643b6c92adfcc68"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handlePatchConfig (cognitive 21): Handler.handlePatchConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"62b928ea9b62564b4b277a267006fd3d8f51124696ce854ab128d5677d211be1"}},{"ruleId":"D2","level":"warning","message":{"text":"main.computeModeAgg (cognitive 20): main.computeModeAgg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"455c0ea5f6dabb499fc9f4d840ef5320168e344058e788dc691da9295c12bd02"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.extractParameters (cognitive 20): mcp.extractParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/show.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"2933cd0c3a90786ccb8a355e44ed74a52837060324211d67a4d289864b9b7c33"}},{"ruleId":"D2","level":"warning","message":{"text":"onboard.onboard (cognitive 20): onboard.onboard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/onboard/helpers.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"f01fd6fb9a8659aec9ec710d4afbaf509fdedfe86f89dd39292da5094a6d126f"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.summarizeMCPToolParameters (cognitive 20): agent.summarizeMCPToolParameters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_command.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"077c14c942f5f51b614d0d8236ef0c58c7959d80f4ebaca46c0bee34e442618d"}},{"ruleId":"D2","level":"warning","message":{"text":"tts.SynthesizeAndStore (cognitive 20): tts.SynthesizeAndStore has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 1). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/tts.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"e353b8ebdc3e126b57256d91135b5eb074ce4ca2e33af34f73581490caacb47f"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.LoginBrowserWithOptions (cognitive 20): auth.LoginBrowserWithOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, match/switch 2 (nesting depth added 7). Of this number, 19 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/oauth.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"32b29eac4708235f38e84494fca0e90dbe6c94b8a55acd5dd9b6aed689faae34"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.extractAccountID (cognitive 20): auth.extractAccountID has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/oauth.go"},"region":{"startLine":609}}}],"partialFingerprints":{"codehealthFindingId/v1":"7814423f972b098025858334e9458d62afedc1a7669900ea4dad3a5b907264ee"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.listenVoiceControl (cognitive 20): DiscordChannel.listenVoiceControl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":861}}}],"partialFingerprints":{"codehealthFindingId/v1":"11f85d5c92d84ca0a0c9b8afa28efe1c6772c0a40be17c2812169038d36a2a0b"}},{"ruleId":"D2","level":"warning","message":{"text":"LLMPatternClusterer.validateAndBuildPatterns (cognitive 20): LLMPatternClusterer.validateAndBuildPatterns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f32a055d657523a35e378393599975d598aa9698491472fdcc362b5b6f324ca"}},{"ruleId":"D2","level":"warning","message":{"text":"isolation.Preflight (cognitive 20): isolation.Preflight has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/isolation/runtime.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"1310b96a889b9d8f111cc581de9939eb226c5c1a5657b2f08c6782df6fd81f76"}},{"ruleId":"D2","level":"warning","message":{"text":"CodexCliProvider.parseJSONLEvents (cognitive 20): CodexCliProvider.parseJSONLEvents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/cli/codex_cli_provider.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"e50328f5f6292fc101edb2d98b009ffb28e528d84e4749491b51db97adada700"}},{"ruleId":"D2","level":"warning","message":{"text":"SkillInstaller.getGithubDirAllFiles (cognitive 20): SkillInstaller.getGithubDirAllFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/installer.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"42a27dfe0e8f0c6094436c36c24c83871d674aa87dad190ecd5f2bf44421e5a6"}},{"ruleId":"D2","level":"warning","message":{"text":"fstools.readNextLinePrefix (cognitive 20): fstools.readNextLinePrefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":776}}}],"partialFingerprints":{"codehealthFindingId/v1":"d915b13bb7eea91e271d725d14e7538544d03ac4169a1f83294ffd314d7d09a7"}},{"ruleId":"D2","level":"warning","message":{"text":"SubagentManager.runTask (cognitive 20): SubagentManager.runTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 1 (nesting depth added 7). Of this number, 18 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/subagent.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a2b3ae3edf9c5683f6f387d21b24a1e923b9cde3573668724be648b98244d8a"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.ExtractZipFile (cognitive 20): utils.ExtractZipFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/zip.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"54739e695a6436b05f00e4c9b40453a79786f2c72c3394203f7ebbdec9757da8"}},{"ruleId":"D2","level":"warning","message":{"text":"api.isLikelyGatewayProcess (cognitive 20): api.isLikelyGatewayProcess has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"f268cf19e1cb65c7445933ebef87c7eba2552d60ad7c3834977d229bc05a51d3"}},{"ruleId":"D2","level":"warning","message":{"text":"api.modelConfigsMatchingSignatureRef (cognitive 20): api.modelConfigsMatchingSignatureRef has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e0e4418443e47c986fb2cb5da6a8bdfa96c08a572f86cbd254b850db148e0f4"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.RestartGateway (cognitive 20): Handler.RestartGateway has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":1293}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3c38f19138c8142980af259c13e9f20386cc53cdb8de573d9ce7b860ee55f47"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.gatewayStatusData (cognitive 20): Handler.gatewayStatusData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"c94888c797c71272f5f45ea2f5aad5a53a02c02d83ab4af92057bc0d8df24e93"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleDeleteSession (cognitive 20): Handler.handleDeleteSession has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":961}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1985beb9c72fe1ee4fe02c9b5553ac9674cab5a400f5e193ecf3adc026896d5"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleInstallSkill (cognitive 20): Handler.handleInstallSkill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca1757046b41d9b9cbf17b5e07dd44607ca67afc7506c374883971ef460b605f"}},{"ruleId":"D2","level":"warning","message":{"text":"cliui.RenderCommandHelp (cognitive 19): cliui.RenderCommandHelp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/help_cmd.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"5446bb5a84fa3e3088e90d5d7da41aa74647f64a37713cd75a534389803431cc"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.loadConfiguredHooks (cognitive 19): AgentLoop.loadConfiguredHooks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 1 (nesting depth added 7). Of this number, 16 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hook_mount.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0d20be1f9c9e850b6bacd26f15ce469273c952ee60b5a8ead182ac76f44cb69"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.firstMeaningfulParagraph (cognitive 19): agent.firstMeaningfulParagraph has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 3, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/discovery.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"2007f6fc102394c1f7e874f3d59a1d7d122e37a6d4769eda9b1478df748e55cb"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.StopAll (cognitive 19): Manager.StopAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1365}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad140e59f7a79f37f8e9d15279778ad5fbc8b654c7ed7198b97f8f5584192bcc"}},{"ruleId":"D2","level":"warning","message":{"text":"PicoChannel.Send (cognitive 19): PicoChannel.Send has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":298}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dfad279e1938050999b907dfde92f95372fe0661bb4f849738418e87b735c89"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.isBotMentioned (cognitive 19): TelegramChannel.isBotMentioned has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":1561}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e2e3e7cfcf252003132c11606910a13ec9ea480a1df4ed3fb906d56499cfe6b"}},{"ruleId":"D2","level":"warning","message":{"text":"config.InitChannelList (cognitive 19): config.InitChannelList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_channel.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"f35219b101e0924eb9fc7e1b8231427ec6e4d940226b7aef51bca84bec91b0c6"}},{"ruleId":"D2","level":"warning","message":{"text":"config.isProvidersMapEmpty (cognitive 19): config.isProvidersMapEmpty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a56ef5a5dc49687feeaf4f81282cd9ad4c52c20300c7d7c26087a13f810658c"}},{"ruleId":"D2","level":"warning","message":{"text":"Runtime.normalizeDraftForWorkspace (cognitive 19): Runtime.normalizeDraftForWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"22ff4250c3e17449a8b65e0ae589b5b937516455f93ef974c3b6566fb7964fdc"}},{"ruleId":"D2","level":"warning","message":{"text":"Runtime.applyCandidateDraft (cognitive 19): Runtime.applyCandidateDraft has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":1347}}}],"partialFingerprints":{"codehealthFindingId/v1":"de103ce5a8f4f082f46d966620a87ac1223c7e025ff1cd9878801dbb2677ef2a"}},{"ruleId":"D2","level":"warning","message":{"text":"common.SerializeMessages (cognitive 19): common.SerializeMessages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/common/common.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"093cd2c8a12f2d84745d2494d31113872e50bb505819106817e78805074811d9"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_responses_common.parseResponse (cognitive 19): openai_responses_common.parseResponse has cognitive complexity 19 (threshold 15). Drivers by points: loops 7, match/switch 7, if/else 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_responses_common/responses_common.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"c71e7788ec73f14174ddfae136762bec79628d1387a5c764d8f7b2679b1e510b"}},{"ruleId":"D2","level":"warning","message":{"text":"CompactionEngine.selectShallowestCondensationCandidate (cognitive 19): CompactionEngine.selectShallowestCondensationCandidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"f098086a836f024453356ab1b324b5f507bb9f3f895fceb1a8c67881810d06f5"}},{"ruleId":"D2","level":"warning","message":{"text":"I2CTool.writeDevice (cognitive 19): I2CTool.writeDevice has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/i2c_linux.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"27213e2f156ef71beb088467a699fc55b66d4618f7b2c797a6217ece28ac5e58"}},{"ruleId":"D2","level":"warning","message":{"text":"GeminiSearchProvider.Search (cognitive 19): GeminiSearchProvider.Search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"6645c4d70f744ca7dbce5feab9cc563945814519aaddf33263035a52782d4514"}},{"ruleId":"D2","level":"warning","message":{"text":"api.fetchOpenAICompatibleModels (cognitive 19): api.fetchOpenAICompatibleModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":807}}}],"partialFingerprints":{"codehealthFindingId/v1":"b905abf1a52f02518147338c75150c204ea7d475678707548c980b8f18d47d0c"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.buildServerConfig (cognitive 18): mcp.buildServerConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/add.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddeb57a8f3ec2aab83c438afa4079215b9e849c8b5800db827c8dcea97295708"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.runAgentLoop (cognitive 18): AgentLoop.runAgentLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a6394533d29966e4cff88a8661c77902b288c46f4968c8049628d28668b183b"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.sideQuestionModelConfig (cognitive 18): AgentLoop.sideQuestionModelConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_coord.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4404a22054d341eb17d2b201cbf45a933388bdf5103cad2ad3500a7415402f0"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.seahorseToProviderMessages (cognitive 18): agent.seahorseToProviderMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context_seahorse.go"},"region":{"startLine":258}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8c2304e9d9fcca59ea849d800e78e5bb7564b1a1d1e8a1660b6725677526c16"}},{"ruleId":"D2","level":"warning","message":{"text":"legacyContextManager.summarizeSession (cognitive 18): legacyContextManager.summarizeSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context_legacy.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb75098d7c8e112a77583f5be62086fda3aa524520947d90148bd2d082ed2286"}},{"ruleId":"D2","level":"warning","message":{"text":"OneBotChannel.SendMedia (cognitive 18): OneBotChannel.SendMedia has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfee6a47ef52170dd3463ddca7fc9dd1b36d674f5f1cdbc354dd4535557a73f5"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.dispatchIncoming (cognitive 18): WeComChannel.dispatchIncoming has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e6fdc7bd2620f20f8144cfe54d6d2a6628f7770cc7baac4d71ce0156062b06e"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.downloadCDNBuffer (cognitive 18): WeixinChannel.downloadCDNBuffer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 4, loops 3 (nesting depth added 10). Of this number, 17 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"d445c2353b5c9cd56a8761862d1470673cfc2d7b971aede31d3409e72dd38de0"}},{"ruleId":"D2","level":"warning","message":{"text":"WhatsAppChannel.listen (cognitive 18): WhatsAppChannel.listen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/whatsapp/whatsapp.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ed3a19878173610305b7ac8065ddbf8a1b0bf16febcfdb050daf0cf835e58d"}},{"ruleId":"D2","level":"warning","message":{"text":"CronService.runLoop (cognitive 18): CronService.runLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 6, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/cron/service.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"2419111abfd3c7a578b98b3038ef7a12b06ecf9ca804f1330e6d30b876ba9710"}},{"ruleId":"D2","level":"warning","message":{"text":"Runtime.recordsForColdPathInputs (cognitive 18): Runtime.recordsForColdPathInputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"347ce4a3ecaecb3276f428b2fb74ebb7fc0e23ca0dc819422db9417c192590a9"}},{"ruleId":"D2","level":"warning","message":{"text":"identity.MatchAllowed (cognitive 18): identity.MatchAllowed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/identity/identity.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"59199b95988bc6e2515a6052680c86b0cb66355fd940e2f7b10c422fd9f8fed2"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.loadEnvFile (cognitive 18): mcp.loadEnvFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/mcp/manager.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac331da9bd9aa040c0f05469b48809f3084ed41688777d4b975e4ef763eaea86"}},{"ruleId":"D2","level":"warning","message":{"text":"MigrateInstance.Plan (cognitive 18): MigrateInstance.Plan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/migrate.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"f78227578aefb08a47a222752120a9f0ee63d32555e7423c6813bd9f61b874ab"}},{"ruleId":"D2","level":"warning","message":{"text":"netbind.probeHostForGroups (cognitive 18): netbind.probeHostForGroups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, match/switch 6, boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/netbind/netbind.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e747b1108e1d402f231bc45b12b24ad347a40174ed5ca773d0fec58f7f4d673"}},{"ruleId":"D2","level":"warning","message":{"text":"api.detectConfiguredSecrets (cognitive 18): api.detectConfiguredSecrets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, match/switch 3, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/channels.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"60d351ef4a72b72716852ce7fb80aa2cc7d3e2509f2150b2e3b4e8a260a2a06a"}},{"ruleId":"D2","level":"warning","message":{"text":"api.isLikelyVersionValue (cognitive 18): api.isLikelyVersionValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 5, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/version.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b9e405babb520a3a6b421a81604f9f73bf976f6ac8468a5350cfc26ea9a79f7"}},{"ruleId":"D2","level":"warning","message":{"text":"main.shouldShowLocalhostConsoleEntry (cognitive 18): main.shouldShowLocalhostConsoleEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e6c61933adfef80c3a5228e6588b0935689cb858017dd548944fd86026a1255"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.publishPicoToolCallInterim (cognitive 17): AgentLoop.publishPicoToolCallInterim has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_outbound.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fce56ae906820737560463fccc6612f9348290d457f8e4fa475f83d58167d33"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.enqueueSteeringMessage (cognitive 17): AgentLoop.enqueueSteeringMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/steering.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d2e556d1fa7f1edb155d6cec5f8b46ec2b6656684460a302d8e0d13a4eb5448"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.promptSourceComponent (cognitive 17): agent.promptSourceComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 5, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/prompt_contributors.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"996aa9e7ccdf3ce84f6842f9c7cf4f49022c75d67c25b2556392dfd340d73c55"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.sendWithRetry (cognitive 17): Manager.sendWithRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1548}}}],"partialFingerprints":{"codehealthFindingId/v1":"518e5cbfa76db4543dd73506caae5ef938a51f58dce610361968765757f3e273"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.sendMediaWithRetry (cognitive 17): Manager.sendMediaWithRetry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"af1f18ef811c1d56ffb50fba100ba7714fdd40ee21969de040e78c73749c37e5"}},{"ruleId":"D2","level":"warning","message":{"text":"pico.parseInlineImageValues (cognitive 17): pico.parseInlineImageValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":1285}}}],"partialFingerprints":{"codehealthFindingId/v1":"77e27e25801e54c1253bc4e131c4b39955b9987b6043fdfe005dc1070cb1afe0"}},{"ruleId":"D2","level":"warning","message":{"text":"pico.parseInlineImageAttachments (cognitive 17): pico.parseInlineImageAttachments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":1324}}}],"partialFingerprints":{"codehealthFindingId/v1":"53ac9eb77524f0c21a4bee30e06038b4c6a0f9da30b00e8aa66ef3912b358226"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.storeRemoteMedia (cognitive 17): WeComChannel.storeRemoteMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"03d05657a60bcc8c80db42ce421ae03b55099ab04bab4a94781ac752a5c6791b"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.readLoop (cognitive 17): WeComChannel.readLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 3, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"60f35fb99a7dbfab70584b74dab37f1466e32dd99eddb19a18535e3197f26c0b"}},{"ruleId":"D2","level":"warning","message":{"text":"config.collectUnknownJSONFields (cognitive 17): config.collectUnknownJSONFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/diagnostics.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"9896a7f83733922837f8e427bde4f9b4b347d8f5867a679a50c208e82c811eee"}},{"ruleId":"D2","level":"warning","message":{"text":"config.resolveLegacyBindingLinkedID (cognitive 17): config.resolveLegacyBindingLinkedID has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/legacy_bindings.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"673c036a363924af8548daa31c72a370396f4ed40879a0c55a646f385faf3977"}},{"ruleId":"D2","level":"warning","message":{"text":"isolation.appendLinuxArgumentMounts (cognitive 17): isolation.appendLinuxArgumentMounts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/isolation/platform_linux.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fe9e3879904d4291ae6d1f68ea73e72e6672637816297f338c88ebdff76ab49"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.newIsolatedIOConn (cognitive 17): mcp.newIsolatedIOConn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 2, loops 1 (nesting depth added 8). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 114). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/mcp/isolated_command_transport.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"68a90f02b7e2044128ae82f095c6c8509939cea53573fbb5d0f518d5d39cb030"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.LoadFromMCPConfig (cognitive 17): Manager.LoadFromMCPConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 2 (nesting depth added 5). Of this number, 9 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/mcp/manager.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e97c4b292b20555948c309759954bac0cee3fb3847fc2e85a49d4d58d89d49c"}},{"ruleId":"D2","level":"warning","message":{"text":"httpapi.parseGeminiResponse (cognitive 17): httpapi.parseGeminiResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"d69ebf098146fa4dbf7d1b903148a6f6624d28108874bfd9d2273a6f3d241044"}},{"ruleId":"D2","level":"warning","message":{"text":"AntigravityProvider.parseAntigravityError (cognitive 17): AntigravityProvider.parseAntigravityError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":661}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6e274b10b18b4c198c17f8f79c929c10738161ef5e220f8629452d9ce413208"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.ReplaceContextItemsWithSummary (cognitive 17): Store.ReplaceContextItemsWithSummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1065}}}],"partialFingerprints":{"codehealthFindingId/v1":"f47fc8dcd90249ca01c89ed5156181222c7d2d3e1a59eb2cedaa8fccf7265b2c"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.sanitizeIdentifierComponent (cognitive 17): tools.sanitizeIdentifierComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/identifier_compat.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"28e19fba39c270b0cd667fb89d088c8dff55092caae5bde8ac5980fe6f89f616"}},{"ruleId":"D2","level":"warning","message":{"text":"hardwaretools.parseSerialWritePayload (cognitive 17): hardwaretools.parseSerialWritePayload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/serial.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"608cfc9f5a74de1b8d6204635d5c15f29c00be210b48d7bdfe5cd2cba15907a2"}},{"ruleId":"D2","level":"warning","message":{"text":"integrationtools.sanitizeIdentifierComponent (cognitive 17): integrationtools.sanitizeIdentifierComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/mcp_tool.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f2bb6ee64cfbac0519420133be5d5d9ee0d12f4dee2f9b5de242ad1a858acc"}},{"ruleId":"D2","level":"warning","message":{"text":"BM25Engine.Search (cognitive 17): BM25Engine.Search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 5, match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/bm25.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eba95f047c77a7157961206ab585c8b3d2a1c8286608df319daeae5923c4cc5"}},{"ruleId":"D2","level":"warning","message":{"text":"api.sessionRefFromMeta (cognitive 17): api.sessionRefFromMeta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0606f80a85a5367092a3497312b45722f719c85943cf40b0f043c2b0297d052"}},{"ruleId":"D2","level":"warning","message":{"text":"api.parsePicoclawVersionOutput (cognitive 17): api.parsePicoclawVersionOutput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/version.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee99fb38ebb449f7bc01e831cf8af4999b8ec5d480edf9461ab0a3e12567c08f"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleOAuthLogin (cognitive 17): Handler.handleOAuthLogin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"80faf600931727e5ba5bee739816dac5bc648b7017ded28998995ae2edbfdbf0"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.persistCredentialAndConfig (cognitive 17): Handler.persistCredentialAndConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":702}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd9d22bf3761c31e671550b81eaf72bbff6052223e56567e22d9a7a85dc5ed19"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runReport (cognitive 16): main.runReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/main.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e38dd3b533003514cc5b3b594919c7c887c1a08999d8843614d1bbb68832601"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.authLoginGoogleAntigravity (cognitive 16): auth.authLoginGoogleAntigravity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/helpers.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"d11c6d56f314bb55706073c182133fe36d2dcb093d423ecad0d4896ffcb99b20"}},{"ruleId":"D2","level":"warning","message":{"text":"cliui.styleUsageTokens (cognitive 16): cliui.styleUsageTokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, match/switch 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/help_cmd.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"b32ed92efd6f2485818e2c19ef54b755f62fa2f118e77979c5b7fbfec0a2828f"}},{"ruleId":"D2","level":"warning","message":{"text":"AgentLoop.applyExplicitSkillCommand (cognitive 16): AgentLoop.applyExplicitSkillCommand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_command.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e79cfa543573a79e20421b4e109ef6e43348f172af14513ab86fa2fe9e6a81d"}},{"ruleId":"D2","level":"warning","message":{"text":"ContextBuilder.buildCacheBaseline (cognitive 16): ContextBuilder.buildCacheBaseline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 2 (nesting depth added 7). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 591). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":570}}}],"partialFingerprints":{"codehealthFindingId/v1":"4da645fa79d3a913cf0de11be9c752447b2665b847e80dd9fa3109e0878476fb"}},{"ruleId":"D2","level":"warning","message":{"text":"evolutionBridge.startScheduledColdPath (cognitive 16): evolutionBridge.startScheduledColdPath has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6, if/else 5, loops 4, boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 284). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/evolution_bridge.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9ceadf2ebabfb6ac226d231a8729b5eeef15418239c975ae020dbb173a9b1a7"}},{"ruleId":"D2","level":"warning","message":{"text":"ProcessHook.call (cognitive 16): ProcessHook.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hook_process.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d76847077b90d2f0617983f09b5ad2ce4d148ad0e85d7c3c87bbf4a40a0cf98"}},{"ruleId":"D2","level":"warning","message":{"text":"DiscordChannel.Send (cognitive 16): DiscordChannel.Send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"177401bf5e5ae7399c4d0dd32b35ef42bfce43f1994d1288afb257751afcffa1"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.Reload (cognitive 16): Manager.Reload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 5). Of this number, 14 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1905}}}],"partialFingerprints":{"codehealthFindingId/v1":"d40241fed25b27c3184f235ab1fa8880abd14c6d03d9bdb2ca16d1d240353240"}},{"ruleId":"D2","level":"warning","message":{"text":"MatrixChannel.Send (cognitive 16): MatrixChannel.Send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/matrix/matrix.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"25fd026917d4da07f008f452b3c41f9766adce25b8ae2d6f39dc7b9b28dc7561"}},{"ruleId":"D2","level":"warning","message":{"text":"SlackChannel.SendMedia (cognitive 16): SlackChannel.SendMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack/slack.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"d211b27ed0451203670952e8feacce99fea3785070887566c0cce9bf57d6528b"}},{"ruleId":"D2","level":"warning","message":{"text":"TelegramChannel.startCommandRegistration (cognitive 16): TelegramChannel.startCommandRegistration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 7, loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 79). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/command_registration.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa1dc976aad4f0bdda4ed2de81ebb28fb9f288a72202dd27a0d7a177991e5bd7"}},{"ruleId":"D2","level":"warning","message":{"text":"WeComChannel.uploadOutboundMedia (cognitive 16): WeComChannel.uploadOutboundMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"99b67de0fff837049aee22745d9667622fed3e22e56807ddeebc8ccb81005b12"}},{"ruleId":"D2","level":"warning","message":{"text":"WeixinChannel.SendMedia (cognitive 16): WeixinChannel.SendMedia has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 6). Of this number, 12 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":1100}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d57563bb8aa453ad04f4be325e27b21983f0db692df5e1dc3b384e5cbcbaee3"}},{"ruleId":"D2","level":"warning","message":{"text":"config.toUniqueStrings (cognitive 16): config.toUniqueStrings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 5, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"103edb0967418df0460e9837cbf35964a3a67c85663da06589c95698d74fe892"}},{"ruleId":"D2","level":"warning","message":{"text":"Runtime.filterRecordsByMinSuccessRatio (cognitive 16): Runtime.filterRecordsByMinSuccessRatio has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":578}}}],"partialFingerprints":{"codehealthFindingId/v1":"58592db6696d1c2bfa9b771ba57cc84281c3d7f88c8d9b636db93f52a1a155a6"}},{"ruleId":"D2","level":"warning","message":{"text":"gateway.setupAndStartServices (cognitive 16): gateway.setupAndStartServices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":406}}}],"partialFingerprints":{"codehealthFindingId/v1":"11071f853498a48a75aafabb5e66a5940b8cad457ddc5fe0c2f2e90d9bcf9fb0"}},{"ruleId":"D2","level":"warning","message":{"text":"Provider.Chat (cognitive 16): Provider.Chat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/azure/provider.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"88369d389ce04c3bfa0007902a6c13c37dec602df8a8fc7f61944488a0ee5c64"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.resequenceContextItemsTx (cognitive 16): Store.resequenceContextItemsTx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"42d88e1c2dfd5bbed07f8049d7611bfcc339cb240a683b04a5575d5b7cfa5c57"}},{"ruleId":"D2","level":"warning","message":{"text":"ExpandTool.Execute (cognitive 16): ExpandTool.Execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, match/switch 5, loops 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/tool_expand.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"91ffe203e647c2d20726b4558ad0d50399c03c5ddfe5c44aeb9c688980ffd6be"}},{"ruleId":"D2","level":"warning","message":{"text":"skills.extractMarkdownMetadata (cognitive 16): skills.extractMarkdownMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 280). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/loader.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"576af12ee1d13b68a5544cfd763a043f1dc29a3b6092b7ab0e99a81fa2ab9c86"}},{"ruleId":"D2","level":"warning","message":{"text":"tools.checkEnum (cognitive 16): tools.checkEnum has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 5, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/validate.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"52d95b5f27a1964ab3edf5daf6baf9b37af3e35f299d4b1804e4a4820d88c7a5"}},{"ruleId":"D2","level":"warning","message":{"text":"DuckDuckGoSearchProvider.extractResults (cognitive 16): DuckDuckGoSearchProvider.extractResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"76d92ccaa753b85cb59600e7ebb75319fef99dc8bf2143f423cd0d71ddff50ed"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecTool.executeSendKeys (cognitive 16): ExecTool.executeSendKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":1044}}}],"partialFingerprints":{"codehealthFindingId/v1":"4412db40fb1b5eb5f30d2e836adf9908dfea3bfbea04d039ea77f761d23d70f1"}},{"ruleId":"D2","level":"warning","message":{"text":"SpawnTool.execute (cognitive 16): SpawnTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 4). Of this number, 12 points are the body\u0027s 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/spawn.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe48ce54904f211c5a62c19991451845f4f78e95897c53f41e0d39c4a34a8bc5"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.NewSafeDialContext (cognitive 16): utils.NewSafeDialContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 136). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/http_guard.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9e2cbf2e69632ff80f6d40e31a8369e487b1d054180fd5db81ca4a57be3bd23"}},{"ruleId":"D2","level":"warning","message":{"text":"launcherAuthHandlers.handleSetup (cognitive 16): launcherAuthHandlers.handleSetup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/auth.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b460042c376a53c7d79deea6867074102d11d931eb661d66b97088a35e56c9d"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.handleSetDefaultModel (cognitive 16): Handler.handleSetDefaultModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":534}}}],"partialFingerprints":{"codehealthFindingId/v1":"a311fe2454b8383c5a60c3060c04eccb1323765b34882802bbeec44943ada621"}},{"ruleId":"D2","level":"warning","message":{"text":"main.shutdownApp (cognitive 16): main.shutdownApp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/app_runtime.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"50e7922b072a00e73bd0be2e3205c4658c29a1fe14c88555a5654de73ea0d812"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Handler: TooManyMethods \u2014 144 methods, declared across 18 files: api/gateway.go (18), api/oauth.go (15), api/session.go (14), api/pico.go (11), \u002B14 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/router.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"313a30900652acfd9ce7a0a0c11fcbf6885ac6381edca38f692ef0528f8ac1a3"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: AgentLoop: TooManyMethods \u2014 104 methods, declared across 20 files: agent/steering.go (18), agent/agent_inject.go (10), agent/agent_event.go (9), agent/agent_message.go (9), \u002B16 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad6d87c7c5d61e3e92f10eb0609de65c8726abc5185b197396609861d2ae8f7d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: integration/web.go: FileTooLong \u2014 1611 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"56f583d1b3a6013baf9ca5c2e32678438d3a587e194b385ad3a2c63d772e9fc0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: channels/manager.go: FileTooLong \u2014 1323 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aed019f52a3861882d1ce25a9a604f7eaef453900b4f2df49d04de36bcb02e42"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/config.go: FileTooLong \u2014 1218 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c13847c93d26e7d463799cd64292af38838a5bd3e7b99cf78f38f8cc42c25fd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: telegram/telegram.go: FileTooLong \u2014 1175 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"253c20dd838edbbd2450642de0cc59127b9870530034106f632ff05ab33e9760"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: evolution/runtime.go: FileTooLong \u2014 1136 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a32427c08492ad0762a7f1b9344d78631d9fdef6cb45000e735384bdf702517"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: seahorse/store.go: FileTooLong \u2014 1096 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ff6a8adfbcf2bee9ece3c22daa79f962ff26df5202993d4f9aba2d7d5d00211"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: pico/pico.go: FileTooLong \u2014 957 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd5f121e913f6eb97fa2fc460126251a6318581189d815d19f3ba70cf4948e63"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tools/shell.go: FileTooLong \u2014 899 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b33442dbc0cf864e331926b4870ffa94d428f22bd5f15a2cab0494953e5aecdb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Store: TooManyMethods \u2014 53 methods. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea42784f20de0b4eb3637036e7c1e0fac2f9d0905c4122ea6042cb49263053db"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: deltachat/deltachat.go: FileTooLong \u2014 850 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/deltachat.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2ac9b8c286f992d29b24a7e0c302902ad7574fd616eb73b074850b82020a548"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: openclaw/openclaw_config.go: FileTooLong \u2014 834 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/sources/openclaw/openclaw_config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"75072b5011d3c56d026f83aa1e5968e5ed7dbf3810d3ac1708314b1074fb6ea4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: fs/filesystem.go: FileTooLong \u2014 818 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d21129ff56fb30bc1da48bfd84a9ebe23ff391af38c35c227129b26f3f8fcbd2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: feishu/feishu_64.go: FileTooLong \u2014 803 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4924e10efdfdc03d588eec279352b8f9f38548368e6a357323b5fc2204bf775"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: weixin/media.go: FileTooLong \u2014 802 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f46a0ef865407b25758674961ef2fe292e5680668d4935393dc780d88e13155"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/context.go: FileTooLong \u2014 788 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f230e83457986922583fc03b0349244b4c789499e4493de53e7473419f520e6"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Manager: TooManyMethods \u2014 47 methods, declared across 2 files: channels/manager.go (40), channels/events.go (7). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad7a1e8825e4d0321b6b71f75c4fff2f489d51c8bdcfd4597bfd625ce3e0a5a5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/skills.go: FileTooLong \u2014 774 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ec7b55daf0ab8c5129916ebf6c66ba2579232bc32cfcb485384d7378cddcfbe"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: onebot/onebot.go: FileTooLong \u2014 750 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e80d1294331e4db051e6cc4adb1d2af7cd948ed1731409f1de2edca4ec4d0a33"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: wecom/wecom.go: FileTooLong \u2014 692 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"18e857ca9e332dfa124fdc44da97c0676c96e676fed01db1580dc848769ab9b0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/models.go: FileTooLong \u2014 690 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f38f2990310dc7db7549376f7a567723bd4bec85c7c88675c2bca2052aa3996"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TelegramChannel: TooManyMethods \u2014 41 methods, declared across 2 files: telegram/telegram.go (39), telegram/command_registration.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/telegram/telegram.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bfc640089bb399abe1ca4a71679c3270786505a6609b4d08e41f55750323214"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/session.go: FileTooLong \u2014 652 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"edec2b653b261cc496a59f4ae37abbcd5bf3b25bd85c9dd8809fcc84e7f516e5"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: turnState: TooManyMethods \u2014 39 methods. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_state.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d246958b2aee6d9361dfe7704941bbc1f7ec9dbb8eb049590df996424352b8a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/hooks.go: FileTooLong \u2014 634 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hooks.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c88abf32ef469433fadf8ee3f029961de9d650747b2e9b7448031491300a628"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: qq/qq.go: FileTooLong \u2014 631 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/qq.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"31bb8a3ea5fe3d7041128fca92839eee0b3d7ba99b607e4237b30c7847a8a9be"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/pipeline_execute.go: FileTooLong \u2014 622 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"103f62ed8939f289ff8427875e3ac37f7ac0b367f90124d62dac1f764435bcb4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: discord/discord.go: FileTooLong \u2014 619 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ab61ad61d7c568545539dc986dfb51f213d426bc13f0837bcc39ee4420309f8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: PicoChannel: TooManyMethods \u2014 37 methods. 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"91ae9d09784a7616b9dec09d021252b0b3f0458bc0af2f5cd383aa671d88df31"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: WeComChannel: TooManyMethods \u2014 37 methods, declared across 2 files: wecom/wecom.go (32), wecom/media.go (5). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/wecom.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"490868ecfc263dea7893e10ed8ef3038bb5bc0830a9e8aa0a3a0c50f459fe67b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: gateway/gateway.go: FileTooLong \u2014 615 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6302982f2466a17d33e66093e129feebd899b0b20e13c0ba3afcb03ce65ddb1"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: DeltaChatChannel: TooManyMethods \u2014 36 methods, declared across 2 files: deltachat/deltachat.go (31), deltachat/handler.go (5). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/deltachat.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0415061925889ede3ecec9ce43f69ea37686d0de1a28a1a596479bd277b9dfd"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: FeishuChannel: TooManyMethods \u2014 36 methods, declared across 3 files: feishu/feishu_64.go (32), feishu/feishu_reply.go (3), feishu/common.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a2fa6593e73f53d65005ff8fc64fa646d4d23ed7a195ff3e4760d18428b39b7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/oauth.go: FileTooLong \u2014 597 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"25a8f039b08f548b9dd68d9e215634c80b9d6fc129bf77cbe76d5fd3b8eaba8e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: httpapi/gemini_provider.go: FileTooLong \u2014 582 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4abc411518bf78ad484c18c58b3b4cc7908ddd92314471aed3327469e5808abd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/turn_state.go: FileTooLong \u2014 570 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_state.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"22c3773c170f0dc6311600e5531903695f5848126346d8272496d43d4fe2490e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: openai_compat/provider.go: FileTooLong \u2014 558 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"21bea42d160d3d7f9576d7eef20155f4c0478fec225ec8ac39d6d6b3abc38792"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: wecom/media.go: FileTooLong \u2014 556 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"223eeec7e218a3c019f83c82fd50b9ed5900d1c70f5ae39d7ba95d9484974511"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/pipeline_llm.go: FileTooLong \u2014 553 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0ab6bb35da64a12366c06cf467f16c2a97e124fd54d04e291c295241bec62dc"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ContextBuilder: TooManyMethods \u2014 33 methods, declared across 2 files: agent/context.go (32), agent/definition.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/context.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a58c888fecdcc5f3a45e61f805c31dac54b034899111d2595365b08dc46d6b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: providers/provider_metadata.go: FileTooLong \u2014 546 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: modelProviderOptionsByName (27-583). 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 \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/provider_metadata.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c18729a4b81d85b84a90098f884e0b70054aa12fb7c3bb82859db28da735ec9b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: evolution/pattern_clusterer.go: FileTooLong \u2014 537 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3fb0c80a82fba1b0b4847aaba17abc775bb0f9c89b0b13cfc9b56c82ae00070"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: DiscordChannel: TooManyMethods \u2014 32 methods, declared across 2 files: discord/discord.go (28), discord/voice.go (4). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e3f74b4a66b83fd4d879f7b14b48fcc35a530ff39434d8314e21c6ef0af23dd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: memory/jsonl.go: FileTooLong \u2014 530 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/jsonl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2383ecad63797221bd8911875a9d9ab66e6adbcae9e38bf2c3afa744d23f1721"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/tools.go: FileTooLong \u2014 519 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"42fdaa15dd33872fb36f6f2c3713d3e6b20be0c85df351edb3a835135809759c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: seahorse/short_compaction.go: FileTooLong \u2014 514 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_compaction.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b9ac3aae82a62c7b5cbca665c7da026270e8e0c274b8f42a06787296fda5238"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: backend/main.go: FileTooLong \u2014 505 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef755b1a5d9ded7ef0dbbddad27acbc4c7be5276a318219c20b160b8f84bd4a0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: api/config.go: FileTooLong \u2014 504 significant lines (blank, comment-only and punctuation-only lines excluded). 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"277bac6848ee18d7367c2dbde997e64b93bf7e8c136b7df44db944053176ef23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): pkg/tools/integration/mcp_tool.go:103-126 | pkg/tools/identifier_compat.go:16-38 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/tools/integration/mcp_tool.go:103\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/mcp_tool.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"be45ff257d6c560e417ec5b12c9a8acfd8526ba01a21815440598eb16bb7dea9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): pkg/tools/integration/helpers.go:81-102 | pkg/tools/normalization.go:269-290 \u2014 before extracting anything, compare \u0060pkg/tools/integration/helpers.go\u0060 and \u0060pkg/tools/normalization.go\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/helpers.go:81\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/helpers.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"446d489ec00027a3a1a1caa39fc9bdcc16406f1b4254c9e0378a0549602113ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): cmd/picoclaw/internal/agent/helpers.go:115-133 | cmd/picoclaw/internal/agent/helpers.go:150-168 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/picoclaw/internal/agent/helpers.go:115\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/agent/helpers.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"58074e8dda847e26c1bb082f6f627e5a2083a90a235f3f04d009c0086b1f6e8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 20): pkg/config/config_old.go:103-119 | pkg/config/config_old.go:124-140 | pkg/config/config_old.go:145-161 | pkg/config/config_old.go:166-182 | pkg/config/config_old.go:187-203 | pkg/config/config_old.go:208-224 | pkg/config/config_old.go:229-245 | pkg/config/config_old.go:250-266 | pkg/config/config_old.go:271-287 | pkg/config/config_old.go:292-308 | pkg/config/config_old.go:313-329 | pkg/config/config_old.go:334-350 | pkg/config/config_old.go:355-371 | pkg/config/config_old.go:376-392 | pkg/config/config_old.go:430-446 | pkg/config/config_old.go:451-467 | pkg/config/config_old.go:472-488 | pkg/config/config_old.go:493-509 | pkg/config/config_old.go:514-530 | pkg/config/config_old.go:535-551 \u2014 all 20 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 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 \u0060pkg/config/config_old.go:103\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"57ab2b71504d9f8b741d34faef1d923696b3be8e3d478d30a497add42a246266"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 3): pkg/config/config.go:1363-1379 | pkg/config/config.go:1417-1433 | pkg/config/config.go:1469-1485 \u2014 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 \u2014 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 \u0060pkg/config/config.go:1363\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8678ccd6b9a2263533d9073c25fd8ff43e263c7bd6a5d56e7b5a59b16e2e439"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): pkg/channels/slack_webhook/slack_webhook.go:102-118 | pkg/channels/teams_webhook/teams_webhook.go:135-153 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/slack_webhook/slack_webhook.go:102\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack_webhook/slack_webhook.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b7a74f1bd2eb2636c7afc57d35ebc8157c8318c15eee437cc0049b89eb40080"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): pkg/isolation/runtime.go:366-382 | pkg/isolation/runtime.go:393-409 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/isolation/runtime.go:366\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/isolation/runtime.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"a042e5011fa0c6d038b0c056e1f04502b93715ba0774cf6ab193cb407a52d1e5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): pkg/seahorse/store.go:1045-1061 | pkg/seahorse/store.go:1142-1158 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/seahorse/store.go:1045\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1045}}}],"partialFingerprints":{"codehealthFindingId/v1":"32398857091e48bc472721bdb2c7e451f48823d1601927f5fb25fa9d0c493272"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): pkg/tools/fs/load_image.go:91-107 | pkg/tools/fs/send_file.go:88-104 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/fs/load_image.go:91\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/load_image.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"571c9828fe44373668ae54f873e65b9b9ffc0c7c74555bf6d8307df4e16c48b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 23): pkg/config/config_old.go:66-81 | pkg/config/config_old.go:90-105 | pkg/config/config_old.go:111-126 | pkg/config/config_old.go:132-147 | pkg/config/config_old.go:153-168 | pkg/config/config_old.go:174-189 | pkg/config/config_old.go:195-210 | pkg/config/config_old.go:216-231 | pkg/config/config_old.go:237-252 | pkg/config/config_old.go:258-273 | pkg/config/config_old.go:279-294 | pkg/config/config_old.go:300-315 | pkg/config/config_old.go:321-336 | pkg/config/config_old.go:342-357 | pkg/config/config_old.go:363-378 | pkg/config/config_old.go:384-399 | pkg/config/config_old.go:417-432 | pkg/config/config_old.go:438-453 | pkg/config/config_old.go:459-474 | pkg/config/config_old.go:480-495 | pkg/config/config_old.go:501-516 | pkg/config/config_old.go:522-537 | pkg/config/config_old.go:543-558 \u2014 all 23 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 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 \u0060pkg/config/config_old.go:66\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"799ac30487c15227a57afe7794bbb1babb05a9e4bd8b658e371693bcc0da1fcc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): pkg/channels/manager.go:1587-1602 | pkg/channels/manager.go:1782-1797 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:1587\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1587}}}],"partialFingerprints":{"codehealthFindingId/v1":"76c66092fe217bfaecaf58b8894cb2d36fdd407dec76b54a0c0abcb2f717fa27"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): pkg/seahorse/store.go:186-201 | pkg/seahorse/store.go:278-293 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/seahorse/store.go:186\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bcef8d480a53ce80a453fa9864fb3e7ead67114fc78eb0066b81c10b9f3b52a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): pkg/tools/integration/helpers.go:45-60 | pkg/tools/normalization.go:106-121 \u2014 before extracting anything, compare \u0060pkg/tools/integration/helpers.go\u0060 and \u0060pkg/tools/normalization.go\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/helpers.go:45\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/helpers.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2b5d9980582e06b4d1d56305385e906deba75da088c9d4034f0b15c2c0630f2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): pkg/providers/factory_provider.go:122-137 | pkg/providers/factory_provider.go:211-226 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory_provider.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"fca1e80779494f0d8197610f039efa54ecf802c61a762f9cfcf99805ff92eaaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): pkg/agent/pipeline_execute.go:140-154 | pkg/agent/pipeline_execute.go:410-424 | pkg/agent/pipeline_execute.go:449-463 \u2014 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 \u2014 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 \u0060pkg/agent/pipeline_execute.go:140\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e03511c9587e16d46b61731b83ea2fba0582ab0fbda83975954427ee59497eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/agent/definition.go:209-223 | pkg/skills/loader.go:362-376 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/agent/definition.go:209\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/definition.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"583a2d0f4c28411b96e6d3a8a59365e37c19b07dddee1d6332a6bb4d28327bd2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/channels/onebot/onebot.go:400-415 | pkg/channels/onebot/onebot.go:455-469 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/onebot/onebot.go:400\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebb97579793d65d1346ca099a7682c8edd79a4419abca81fc3cc560dc7a7889a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/channels/qq/qq.go:623-637 | pkg/channels/qq/qq.go:692-706 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/qq/qq.go:623\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/qq/qq.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb04e327022ee8cb2baeb4e575885f4075322a2b390a94283234e383af71cf7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/providers/fallback.go:210-225 | pkg/providers/fallback.go:329-343 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/providers/fallback.go:210\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/fallback.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"e64254977a8214a43e2878427cd0fb87dc5060ce0bc50f215a9be311eec5771c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/agent/pipeline_execute.go:185-200 | pkg/agent/pipeline_execute.go:478-492 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/pipeline_execute.go:185\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a839aa409247b40214276aa13016a0694093e6011ff8d873f175aea7c52bf8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/agent/pipeline_execute.go:360-374 | pkg/agent/pipeline_execute.go:748-762 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"422e1a5cd19558f5803ae74fabf0502e422141ce938c958806207f38ce17523b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): pkg/config/config.go:1335-1350 | pkg/config/config.go:1393-1408 | pkg/config/config.go:1451-1464 \u2014 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 \u2014 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 \u0060pkg/config/config.go:1335\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1335}}}],"partialFingerprints":{"codehealthFindingId/v1":"00f5e962c16364c382ba8050fb54a3274f88732622f31e90b4b62476f3eb2cd6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): pkg/tools/integration/web.go:312-325 | pkg/tools/integration/web.go:445-458 | pkg/tools/integration/web.go:1144-1157 \u2014 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 \u2014 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 \u0060pkg/tools/integration/web.go:312\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0b1396f2b95974e31d10e6b89684a2ed51e40c98bd41bb073a46d00d4117a1f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/agent/agent_utils.go:384-397 | pkg/memory/jsonl.go:158-171 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/agent/agent_utils.go:384\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_utils.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"a25a30256243be53d38858d1d14f7bdae644583228d93a5dec320c3419e00e2d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/channels/pico/client.go:212-225 | pkg/channels/pico/pico.go:1160-1173 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/pico/client.go:212\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/client.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"a93cf28fbbf3891fc95dd2ce639dd9637ddcfbcef1fa3eaa3a064c80090a015f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/providers/fallback.go:186-200 | pkg/providers/fallback.go:308-321 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/providers/fallback.go:186\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/fallback.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"05d869d4a55fab578a1d95ae8599facfbb381317fa81c92815eb3aecdde76e2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/routing/route.go:279-292 | pkg/session/key.go:147-160 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/routing/route.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fdd1af4fa0d33ffc2839c7a36def3b9bb4bcccec6d6bbeb66bd76fbbecc1511"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/seahorse/store.go:360-373 | pkg/seahorse/store.go:690-703 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"b872c7b825797f37838ac8543ae8bfa4823e0f896d088af6a819b4648c837dd5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): web/backend/api/config.go:99-112 | web/backend/api/config.go:216-229 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/config.go:99\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"42e1d695cceab1a90d2a5eabace62a39a0c5147174a76ccac1f81f4e3bb80fac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): cmd/membench/main.go:131-144 | cmd/membench/main.go:169-182 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/main.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f94a81c13e960956443a5d935b4f97ac81b795edf1c7b7997775ea723f24489"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/agent/pipeline_execute.go:312-325 | pkg/agent/pipeline_execute.go:701-714 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/pipeline_execute.go:312\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"234c73036060cd9c6f8c9684e19f46e1ffa7791d908d24303fccfb1951d532d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): pkg/tools/shell.go:629-641 | pkg/tools/shell.go:665-677 | pkg/tools/shell.go:685-697 \u2014 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 \u2014 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 \u0060pkg/tools/shell.go:629\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"43cb16f17351eef31d45b5009eb8ee8f61c2b60ed44908827cb363dd1e7c60c9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): cmd/membench/eval.go:76-88 | cmd/membench/eval.go:183-195 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/membench/eval.go:76\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"0194ad5477f8b631eea57455a13243a73e2e533b681b1fc3a543c78a0f606a76"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/agent/hooks.go:370-382 | pkg/agent/hooks.go:520-532 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/hooks.go:370\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hooks.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"07dbd536c5acb26ed4eadd7b9dc77d9b31d0dafb1006f8923a6959f68f7590a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/auth/oauth.go:254-266 | pkg/auth/oauth.go:345-357 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/auth/oauth.go:254\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/oauth.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcb1b64db2bde2036b601161fc99736c69ea2fbe3e199a8521b70ce5991586ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/channels/deltachat/deltachat.go:711-723 | pkg/evolution/runtime.go:226-238 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/deltachat/deltachat.go:711\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/deltachat.go"},"region":{"startLine":711}}}],"partialFingerprints":{"codehealthFindingId/v1":"277487f2be542c2486155ac318b3527fcef1a374cf02872e7b6ee4e151dd387c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/channels/manager.go:377-389 | pkg/channels/manager.go:521-534 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:377\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb0a36e3a4a2ace17051a15196b0e3f12a08353e60a7b3e2f09d6b7ebcd305d4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/evolution/pattern_clusterer.go:171-183 | pkg/evolution/pattern_clusterer.go:243-255 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/evolution/pattern_clusterer.go:171\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"3925b569972074c73b1ef18ba17953ff274231eeb0e7b35df23959e0fb561531"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/evolution/pattern_clusterer.go:423-435 | pkg/evolution/pattern_clusterer.go:488-500 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/evolution/pattern_clusterer.go:423\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/pattern_clusterer.go"},"region":{"startLine":423}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a4f8da0c5895ef4c4408851c52e33633f0dd435513c10757bba8ced9e16c287"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/memory/jsonl.go:693-705 | pkg/memory/jsonl.go:756-768 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/jsonl.go"},"region":{"startLine":693}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ec5159fe38c91babf80a182547011951e470c0e0ac4fe9b969ade9d8fe65fb1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/tools/integration/helpers.go:30-42 | pkg/tools/normalization.go:91-103 \u2014 before extracting anything, compare \u0060pkg/tools/integration/helpers.go\u0060 and \u0060pkg/tools/normalization.go\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/helpers.go:30\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/helpers.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"6aadaac23a6ab3752326262d1e30cda40d7f351391131b0a0a54e30681f4a03a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): cmd/membench/eval.go:132-146 | cmd/membench/eval_llm.go:220-231 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/membench/eval.go:132\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"6beef028638726af4f9d601f426b37993dc4f78be39350ccbab10e02e2f07778"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): cmd/picoclaw/internal/mcp/helpers.go:292-303 | pkg/mcp/manager.go:30-42 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/mcp/helpers.go:292\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/helpers.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"faf02130e2e4c0a2b36cfd9942c86d142c731287b9c6133178bc0b2b1b849039"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): cmd/picoclaw/internal/mcp/show.go:115-126 | pkg/agent/agent_command.go:421-437 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/mcp/show.go:115\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/show.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"894d79c16451ca973a362596954012c4a9dc005db157064ffa95fecfd6b323d0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): cmd/picoclaw/internal/skills/helpers.go:328-339 | pkg/migrate/internal/common.go:101-112 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/skills/helpers.go:328\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/skills/helpers.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"5434b1a001770486587295b1f7c5f0b5a291b578cfdbcc4c757a70d7279d028b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/agent/hooks.go:326-337 | pkg/agent/hooks.go:358-369 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/hooks.go:326\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hooks.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bf04e9e982f1c230b2e87752c9aff5265cf63837399b7cff994b55ca1cc0129"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/agent/hooks.go:470-481 | pkg/agent/hooks.go:508-519 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/hooks.go:470\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hooks.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8cee22335c8d3227a06c2f67b8b7deae62dacaa60f74258858bc968749b32e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/channels/weixin/media.go:182-193 | web/backend/api/tools.go:545-556 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/media.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"25c796c6131ec19179888b888e754e6b7de647109c5366df97f6ffcddcf7b43b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/providers/oauth/antigravity_provider.go:227-238 | pkg/providers/oauth/antigravity_provider.go:280-291 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/providers/oauth/antigravity_provider.go:227\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd5ee8b7857a4452b9f3d4f11ddad2852cd7246db65f6616c5864265bd560fb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/seahorse/store.go:1412-1423 | pkg/seahorse/store.go:1570-1581 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1412}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4cafe37f847dbe6b63adbb7c6f9b98657e7533a19b5524553267902e412fbe5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/tools/fs/filesystem.go:849-860 | pkg/tools/integration/helpers.go:121-132 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/tools/fs/filesystem.go:849\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"765ea78b7f9192433a0ad5bee82cef32effef2a38b1338b93649fa0ebf456212"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/tools/shell.go:748-759 | pkg/tools/shell.go:777-788 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/shell.go:748\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4245d7466a02b8caef12e1ee87a07c6e446e8482659b4926811d1b0dd52526f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): web/backend/api/models.go:497-508 | web/backend/api/models.go:937-948 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/models.go:497\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"15480344bab3e2bcecbe3cb88714204bfbcfc987a81d030987bb341a4cffbfc5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): web/backend/api/models.go:762-773 | web/backend/api/models.go:809-820 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":762}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f53e1d089579ec187ecbf607871cb8dfe871ceda11c3d490d7c0ee605e8eafc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/agent/pipeline_execute.go:246-257 | pkg/agent/pipeline_execute.go:626-637 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/pipeline_execute.go:246\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b25588a4dda09fc35c05568baae2373e2e28fb3b3894cabd80327703059f5d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): web/backend/api/models.go:393-403 | web/backend/api/models.go:499-509 | web/backend/api/models.go:939-949 \u2014 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 \u2014 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 \u0060web/backend/api/models.go:393\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b44dc87ae8200daf10f9f1058a832d8a47a29afcb46ce4d674e3ab76b06979d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): cmd/picoclaw/internal/auth/wecom.go:363-373 | web/backend/api/wecom.go:310-320 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/auth/wecom.go:363\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/wecom.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0492e4a4c61bc19d6d4be0c3d0752fe87ecc7d2400cc475c95956a1e9f7738b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): cmd/picoclaw/internal/mcp/helpers.go:337-347 | cmd/picoclaw/internal/mcp/show.go:40-50 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/picoclaw/internal/mcp/helpers.go:337\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/helpers.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bc82cb3d0cf198781b8738bc91dcb6fb12001f2966a9a6ffc1880b0bb71e791"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): cmd/picoclaw/internal/mcp/show.go:74-84 | pkg/agent/agent_command.go:379-389 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/mcp/show.go:74\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/show.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"47603efdca0f0d4b6fac467eb8e9696e7d40c4d39d3e1ee68a9474ac0d32ce95"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): cmd/picoclaw/internal/mcp/show.go:130-140 | pkg/agent/agent_command.go:443-462 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/mcp/show.go:130\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/show.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"7050c3aa4cecbb56bfebb35a0c44fb6289d68ad725ce577a37ead13b9018ba80"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/agent/hook_mount.go:270-280 | web/backend/api/gateway.go:646-656 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hook_mount.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"21f447d5528739ac6ebe05525250cc86a215e2d35e46f036870d1ff487cf9d8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/agent/pipeline_streaming.go:355-365 | web/backend/api/channels.go:195-205 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/agent/pipeline_streaming.go:355\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_streaming.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5af05e909b174b88c793bf0225139e9737f4b38d701bf70a1fd0937cc625cec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/channels/manager.go:1231-1241 | pkg/channels/manager.go:1954-1964 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:1231\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1231}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea46870980ede4367483f58168d9898222c0d26b624042079b3923d56b17d2c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/channels/manager.go:1247-1257 | pkg/channels/manager.go:1967-1978 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:1247\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"3048b4eb7297992ebdd8d6a816fe6576e2760f8e64f2e54c8f5addf2b9756fca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/channels/pico/pico.go:860-870 | web/backend/api/session.go:661-671 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/pico/pico.go:860\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/pico/pico.go"},"region":{"startLine":860}}}],"partialFingerprints":{"codehealthFindingId/v1":"123688664b817a3e5ce6d1cf70c439c8cda3551fc1e9bfd303e3f081bd6267e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/channels/slack_webhook/convert.go:253-263 | pkg/channels/teams_webhook/teams_webhook.go:413-425 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/slack_webhook/convert.go:253\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack_webhook/convert.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"8aae21cc4af948a52ce5837dd86750e3c1ba8bb3eaa32957daf24cfb3b70b255"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/channels/wecom/media.go:50-60 | pkg/channels/wecom/media.go:73-83 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/wecom/media.go:50\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"b63fd6b41c0fb66e94329763e1733de19d1cc6b606bfc01e2c7031f9c9f441a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/config/config.go:1382-1392 | pkg/config/config.go:1439-1450 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/config/config.go:1382\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1382}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ca5cb43d1a8c8268d7b04cc9545d5b343f7bc97eecdea815ec9adc6959b2298"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/providers/httpapi/gemini_provider.go:75-85 | pkg/providers/httpapi/gemini_provider.go:142-152 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/providers/httpapi/gemini_provider.go:75\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe962c9805a381a03bf1a512b9eabb06720f04d6376d6e1088eaf475c2fff851"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/providers/httpapi/gemini_provider.go:163-173 | pkg/providers/openai_compat/provider.go:568-578 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/httpapi/gemini_provider.go:163\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"8026ab865741cacdbcbd69c1f6bbaaef17d56061791c0076a9a7b71d402574a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/seahorse/short_engine.go:336-346 | pkg/seahorse/short_engine.go:352-362 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/short_engine.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"a726dbbf9f90a530f8bc93530e7452fc14391b80cffb098812813983f97d78d4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/seahorse/store.go:1656-1666 | pkg/seahorse/store.go:1683-1693 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/seahorse/store.go:1656\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1656}}}],"partialFingerprints":{"codehealthFindingId/v1":"a07c10715c936ab1ce89aabd348b4ad5ffbeedf0e2235a2d072f5f447d35305c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/tools/shell.go:818-828 | pkg/tools/shell.go:857-867 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/shell.go:818\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":818}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fcb36195c27b3de5b7257520be5f45f28c7854e39d5121fd24fab3e095373e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): web/backend/api/oauth.go:322-332 | web/backend/api/oauth.go:339-349 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0d2dae72344053e4573969e2f863d982d589923063bd474b17d3c2e1e7d1b0a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): web/backend/api/oauth.go:806-816 | cmd/picoclaw/internal/auth/helpers.go:239-249 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":806}}}],"partialFingerprints":{"codehealthFindingId/v1":"723f30ca9bf91929c6a91f96312b316878a173c86481e7c35e8fc14df4a28b91"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): web/backend/api/wecom.go:233-243 | web/backend/api/weixin.go:233-243 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/wecom.go:233\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/wecom.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab37c53060060cbab8db2c63d7511ec0017f4d88cb7b267288e132ef369e8a9c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/auth/token.go:12-22 | pkg/auth/token.go:36-46 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/token.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"2835d4f83f73fcdd94e68a74688b03b88f80fa236208b22c58979560ae910b16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): pkg/channels/wecom/media.go:502-511 | pkg/channels/wecom/media.go:519-528 | pkg/channels/wecom/media.go:531-540 \u2014 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 \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"951dccca098d92e6b06c5ae4e8f1d2ac10f7a11cd249f31b57e6622a9fe06b87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/membench/eval.go:58-68 | cmd/membench/eval_llm.go:146-155 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/membench/eval.go:58\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cde721108505ff7eb09b220033c132a26d3340c1a685b31fefb5caaf374f5ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/membench/eval.go:287-296 | cmd/membench/eval.go:355-364 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f2bb3fa425093c7cbd12e8c9096e757ccc58440d571cd24f52b06109c8a7b1b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/picoclaw/internal/auth/wecom.go:350-359 | web/backend/api/wecom.go:297-306 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/auth/wecom.go:350\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/wecom.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcdbd4c4afdc3522063d1e065eada2f93c0c7f6833626327a6f61cab4592587d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/picoclaw/internal/auth/wecom.go:396-405 | web/backend/api/wecom.go:329-338 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/auth/wecom.go:396\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/auth/wecom.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"6afea95121e3ce61bbf13114200c5ff61c9310d43eb380d753524651a458991e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/picoclaw/internal/mcp/show.go:102-111 | pkg/agent/agent_command.go:408-417 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/mcp/show.go:102\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/mcp/show.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6367fecffbe29e4600e387597c892a346197f6ab31c26c757551c0e9abb85d8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/picoclaw/internal/skills/helpers.go:350-359 | pkg/migrate/internal/common.go:150-159 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060cmd/picoclaw/internal/skills/helpers.go:350\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/skills/helpers.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"495c83bdef25878f2cf2a7b3155046406e52156f31fde260999279025bbc28b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/agent/turn_context.go:83-92 | pkg/routing/route.go:140-149 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/agent/turn_context.go:83\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/turn_context.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a32f81ab2901d9e980e5efaf357738c9b4205ee6d3f8d9083e5f56970055943"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/audio/tts/mimo_tts.go:110-119 | pkg/audio/tts/openai_tts.go:180-189 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/audio/tts/mimo_tts.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6a2dca9e4772ddf1486d73136d4cd8b4692397213dc30447856644031885fb5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/channels/feishu/feishu_64.go:310-319 | pkg/channels/feishu/feishu_64.go:1076-1085 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/feishu/feishu_64.go"},"region":{"startLine":310}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad02999155dbb9e3526bde7ed332c5490df618c02d6f75e0a4cbd016d4714984"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/channels/manager.go:2045-2054 | pkg/channels/manager.go:2084-2093 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:2045\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":2045}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc5d031631ae18ce02b864a38a2417a3fb41c12dce1cc54c07692372c262e148"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/channels/onebot/onebot.go:429-438 | pkg/channels/onebot/onebot.go:540-549 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/onebot/onebot.go:429\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"45562c017093117ab16353df30b3d6c2b2e0edbb0a7b0916f624ff8597061bad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/channels/slack/slack.go:608-617 | pkg/channels/slack/slack.go:623-632 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/slack/slack.go:608\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/slack/slack.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"943cf00089cff1d9338d22cf838cbf2277f56ee6e53e23d5384c57a4d34ae216"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/channels/weixin/api.go:48-57 | pkg/providers/common/common.go:51-60 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/weixin/api.go:48\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/weixin/api.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"0145b8f6db73f0a980beaf7581d44b364f7193ff876825f7bb29493a581c7f78"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/evolution/drafts.go:68-77 | pkg/evolution/skills_recall.go:19-28 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/drafts.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fe90e174a0e03425711ad9f606f614c14b9776494df928bb41c58a95f0bcfc6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/providers/anthropic_messages/provider.go:206-215 | pkg/providers/anthropic_messages/provider.go:284-293 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/providers/anthropic_messages/provider.go:206\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic_messages/provider.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"92e70f806772c299e7243b7e697eedc488e2069fc24f680108ff0068bb91ab94"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/providers/azure/provider.go:198-207 | pkg/providers/openai_compat/provider.go:493-502 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/azure/provider.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6404aae0e08efc42c13ff75f641ab2957bc06de6efb2dfa9c921c730da279b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/providers/httpapi/gemini_provider.go:482-491 | pkg/providers/oauth/antigravity_provider.go:381-390 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/httpapi/gemini_provider.go:482\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcdca2d568a3313ce52a770264bab36c5e11b61b84c361fd19e5d1a970fc4583"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/providers/openai_compat/provider.go:474-483 | pkg/providers/openai_compat/provider.go:545-554 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5078f58b60a6fc23235f257d1a062cc8cd450af7514841088c34177aef011e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/routing/agent_id.go:31-40 | pkg/routing/agent_id.go:53-62 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/routing/agent_id.go:31\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/routing/agent_id.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"44fecb388a112d880456ced0bdaa33f5bee5f6bba59abfb26a67abf1b73e10ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/tools/cron.go:297-306 | pkg/tools/cron.go:314-323 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/cron.go:297\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/cron.go"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2e259e0e3e17776d6d90f2b02a8381d2e7274c2a27d78561b0642edd015a43d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/tools/cron.go:611-620 | pkg/tools/cron.go:635-644 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/cron.go:611\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/cron.go"},"region":{"startLine":611}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d348cd224da5498ed7804b806c97374841ea43050c7982202f4312f54c891d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/tools/fs/send_file.go:153-164 | pkg/tools/integration/message.go:342-351 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/tools/fs/send_file.go:153\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/send_file.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"23b7158fa8bc2ffeee5cdcdb12c650d0f243dd194ffc03741372bd085d582379"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/tools/integration/web.go:489-498 | pkg/tools/integration/web.go:1448-1457 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/web.go:489\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"e624fd1da70a8e35678b6c456f95242e6fba2b71fdc1c1502f2103d7f08c5455"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/tools/integration/web.go:1304-1313 | pkg/tools/integration/web.go:1400-1409 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/web.go:1304\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1304}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f8011f795d6171e41ae7f9cf01a18199015439aeba70d1b9bf208d75da327cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): web/backend/api/model_catalog.go:60-69 | web/backend/api/models.go:614-628 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/model_catalog.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"74a29503a3ce638632a225cda62badf73ca76abc1c9e904b2c658402130f2636"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): web/backend/api/skills.go:120-129 | web/backend/api/skills.go:139-148 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"24288531dbbef48232e3e0ec0a5607562afe4e730b36bfcce273b6722bd61f2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): web/backend/api/skills.go:557-566 | web/backend/api/skills.go:576-586 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/skills.go:557\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/skills.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ddb7677aa99ac0d8a59cdca2698edcf73d0f05a354885426871a63c461f2c72"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): web/backend/api/tools.go:544-553 | web/backend/launcherconfig/config.go:74-83 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060web/backend/api/tools.go:544\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/tools.go"},"region":{"startLine":544}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2f625b8eeff6853b837da79217be620c851e06a15f5657cfa079b9f42798328"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/picoclaw/internal/cliui/help_cmd.go:71-82 | cmd/picoclaw/internal/cliui/help_cmd.go:114-123 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/picoclaw/internal/cliui/help_cmd.go:71\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/picoclaw/internal/cliui/help_cmd.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d4f23721fbc1354fffd8ca41f8e346f7dcda8d9e6b5ab7a06dcbadf806a76c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/utils/context.go:64-77 | pkg/utils/context.go:136-145 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/utils/context.go:64\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/utils/context.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"a825512407da36637b54c0f0fcd41c9caad2dea500ef9bb90d2503ad49a119e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 23): pkg/config/config_old.go:49-57 | pkg/config/config_old.go:76-84 | pkg/config/config_old.go:100-108 | pkg/config/config_old.go:121-129 | pkg/config/config_old.go:142-150 | pkg/config/config_old.go:163-171 | pkg/config/config_old.go:184-192 | pkg/config/config_old.go:205-213 | pkg/config/config_old.go:226-234 | pkg/config/config_old.go:247-255 | pkg/config/config_old.go:268-276 | pkg/config/config_old.go:289-297 | pkg/config/config_old.go:310-318 | pkg/config/config_old.go:331-339 | pkg/config/config_old.go:352-360 | pkg/config/config_old.go:373-381 | pkg/config/config_old.go:427-435 | pkg/config/config_old.go:448-456 | pkg/config/config_old.go:469-477 | pkg/config/config_old.go:490-498 | pkg/config/config_old.go:511-519 | pkg/config/config_old.go:532-540 | pkg/config/config_old.go:553-561 \u2014 all 23 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 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 \u0060pkg/config/config_old.go:49\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_old.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"208bbe6a1c301550cece0150cfa25af534227a97e9dfcaf3d1f348d0238982c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 4): pkg/channels/discord/discord.go:453-461 | pkg/channels/feishu/feishu_64.go:403-411 | pkg/channels/matrix/matrix.go:724-732 | pkg/channels/telegram/telegram.go:574-582 \u2014 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 \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/discord/discord.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0e06226dc4b45c7fead468eadf3ea144670c7e656ddae06b7f6283431dc4e2e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): cmd/membench/eval_llm.go:169-177 | cmd/membench/eval_llm.go:306-314 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/membench/eval_llm.go:169\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval_llm.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"c01edbc1fbbfc13abf32f6941c5d60faf8cbd952fa2e2f92bed867c46fa5aa16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/auth/anthropic_usage.go:36-44 | pkg/providers/oauth/antigravity_provider.go:568-576 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/auth/anthropic_usage.go:36\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/auth/anthropic_usage.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"16774aae7e4c25a492139784428bb1d3ec868af0e4494ebbe39d925a3efddc53"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/channels/whatsapp/init.go:13-21 | pkg/channels/whatsapp_native/init.go:15-23 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/whatsapp/init.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"07c1a8e735f843a990712d7c91cb829121d759641eef2376f7e1e2a3458157a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/config/config_struct.go:395-404 | pkg/config/config_struct.go:602-610 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/config/config_struct.go:395\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc1fd6c03c02d9bf75030125b1e29b78b5453a99383c609ca782c6df907c3529"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/providers/oauth/antigravity_provider.go:524-532 | cmd/picoclaw/internal/auth/helpers.go:244-252 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/oauth/antigravity_provider.go:524\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/oauth/antigravity_provider.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"06808921a9ca25af7a69716af6d9db9aea2383db3273160cc3cb7f343d44b614"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/session/scope.go:18-26 | pkg/bus/outbound_context.go:70-78 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/session/scope.go:18\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/scope.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"36ed17677d103488d8ebc5b4bb6dc3595297b9b86a6ff725636eb7f94bf68e55"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/tools/hardware/i2c_linux.go:166-174 | pkg/tools/hardware/i2c_linux.go:266-274 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/i2c_linux.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4dfe16afb60d8d4e4f3a84a35d776ff5704c651014594f45366353b95f29d19"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/tools/hardware/i2c_linux.go:255-263 | pkg/tools/hardware/spi_linux.go:92-100 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/i2c_linux.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"385de156122da165dda418fe04ce9aa038d1d44deb94e2bdf5250ca2fde439d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/tools/hardware/spi_linux.go:116-124 | pkg/tools/hardware/spi_linux.go:173-181 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/hardware/spi_linux.go:116\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/spi_linux.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"186e2f1e37a99ad77727197c24cee1764309c2cc81b0402c46fffd672015035c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/tools/integration/web.go:818-826 | pkg/tools/integration/web.go:1322-1331 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/integration/web.go:818\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":818}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab57c5c1009bbcad32d736f55e014b78e4f1946a9d2f230ac510fd2533bfeb5b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): web/backend/api/config.go:53-61 | web/backend/api/config.go:135-144 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/config.go:53\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e86cc5c2b3d615c503ed633e34d976f895e0ef5f4edde1221c973b4a428d072"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): web/backend/api/config.go:145-154 | web/backend/api/models.go:392-400 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/config.go:145\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"20d6c9470dcf1f9e89c2bd6a2d99d1bbcf48ba16a8b22cf82648535a5f3332be"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): web/backend/api/gateway.go:57-65 | web/backend/api/gateway.go:1133-1141 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/gateway.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae338e4f573994d34223fc27eb7e5bdf3001803a79c0393801c1338c2ccf47b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): web/backend/api/launcher_config.go:58-66 | web/backend/api/launcher_config.go:98-106 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/launcher_config.go:58\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/launcher_config.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"96fd94b61dcee57f185ab30c8b9318995b5103cd5257e76b5a0de18b2a057871"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): web/backend/api/oauth.go:187-195 | web/backend/api/oauth.go:467-475 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/oauth.go:187\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/oauth.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a5cb426cc75f46467666fb444220c4ed6956d95ec29f72909fd232a636ab941"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/agent/pipeline_llm.go:365-373 | pkg/agent/pipeline_setup.go:60-68 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/pipeline_llm.go:365\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecbbbd944382d72f1ee1dbb51a4d365aaab14faf11c7b3ddccb41fec2628afd1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/channels/deltachat/init.go:13-21 | pkg/channels/irc/init.go:13-21 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/deltachat/init.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"012103af959e678e7ace4b74253e58752bbd7ea6af8fe042c91735c8c506a8e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/channels/onebot/onebot.go:523-530 | pkg/channels/onebot/onebot.go:591-598 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/onebot/onebot.go:523\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddb461f40bf57b3b12a386e7527051fa2e9b866eddf2b4e92a7f507637b85bc0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/channels/wecom/media.go:332-339 | pkg/channels/wecom/media.go:400-408 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/wecom/media.go:332\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"a03db1ca81e7f3da60dcae73a7eb975bee300a55146dd2a661b89b4e2fe921da"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/config/config_struct.go:644-651 | pkg/config/security.go:131-139 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/config/config_struct.go:644\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":644}}}],"partialFingerprints":{"codehealthFindingId/v1":"1790cac0eebab74a0dc47b7bc516b3235116f9042b979a1c99b5321ccd2cdaf7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/gateway/gateway.go:433-440 | pkg/gateway/gateway.go:681-688 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/gateway/gateway.go:433\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"4583ababdb73222cf7141a87b554ac53d88ef4e7e5ce0d2b59cade8a6ecc3a6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/providers/anthropic/provider.go:197-204 | pkg/providers/anthropic_messages/provider.go:251-260 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/anthropic/provider.go:197\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic/provider.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b8c885e0cd1440b978700b37df5f44cd82aaa0ab7ea7643687dddace518736f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/providers/anthropic/provider.go:389-396 | pkg/providers/anthropic_messages/provider.go:369-376 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/anthropic/provider.go:389\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/anthropic/provider.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d40a8da20fd5878938c10cdca4011403addce59dc7ebd9c2aa6a72bd1667b57"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/providers/httpapi/gemini_provider.go:93-100 | pkg/providers/openai_compat/provider.go:492-499 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/httpapi/gemini_provider.go:93\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee1c3251abb16a20fe21528bfd559d09d4b5572cc518b4d4bda229f0b965a80a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/providers/httpapi/gemini_provider.go:195-202 | pkg/providers/openai_compat/provider.go:597-604 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/providers/httpapi/gemini_provider.go:195\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/httpapi/gemini_provider.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"26e733aee2e7ec825068ebf4aa57e34e82ed1f7b88858ad485fc89d66dff5ab5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/skills/clawhub_registry.go:383-390 | pkg/utils/download.go:45-53 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/skills/clawhub_registry.go:383\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/skills/clawhub_registry.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7e7dacb5580d988fdb9fb9434aeb9eddeb64bf08060413c5438fe920ad75530"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/tools/hardware/spi_linux.go:128-135 | pkg/tools/hardware/spi_linux.go:184-191 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/tools/hardware/spi_linux.go:128\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/hardware/spi_linux.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e0b8d7acbd55456353e29c1d88149f3b4601481bb302b3564be52993a386b2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): web/backend/api/config.go:37-44 | web/backend/api/tools.go:407-414 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/config.go:37\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/config.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b4359315af920704ccbc3693c01fedfc8a72e5fb2f0fa4d6cb6ac12cfc90290"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): web/backend/api/session.go:245-252 | web/backend/api/session.go:261-268 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/session.go:245\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/session.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"359a6884db973b466d7cc825cc912013b3878a3471c15ed7bdedc6f24a5b3f18"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/agent/pipeline_setup.go:23-30 | pkg/agent/pipeline_setup.go:65-72 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_setup.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e7f38e3cdcf99cb6c7f4f95f927c6c8ca8dcd35fc3d562c80eea8b565f726b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): web/backend/utils/runtime.go:72-79 | web/backend/utils/runtime.go:104-111 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/utils/runtime.go:72\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/utils/runtime.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"7181a95ac37d9f0446e46b63ca745fe3985e11b1359e7354310fc9f6a6a5554e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 17): pkg/channels/line/init.go:12-18 | pkg/channels/maixcam/init.go:12-18 | pkg/channels/matrix/init.go:14-20 | pkg/channels/onebot/init.go:12-18 | pkg/channels/slack/init.go:12-18 | pkg/channels/teams_webhook/init.go:12-18 | pkg/channels/wecom/init.go:12-18 | pkg/channels/whatsapp/init.go:12-18 | pkg/channels/whatsapp_native/init.go:14-20 | pkg/channels/dingtalk/init.go:12-18 | pkg/channels/discord/init.go:13-19 | pkg/channels/feishu/init.go:12-18 | pkg/channels/pico/init.go:12-18 | pkg/channels/pico/init.go:34-40 | pkg/channels/qq/init.go:12-18 | pkg/channels/slack_webhook/init.go:12-18 | pkg/channels/telegram/init.go:12-18 \u2014 there are 17 copies across 16 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 17 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/line/init.go:12\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/line/init.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"8db18cd8e37159510bd065492e67916bb6ffbf6db23476cae4ee39286fd2dc2c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): pkg/agent/agent_utils.go:56-62 | pkg/session/scope.go:25-31 | pkg/bus/outbound_context.go:77-83 \u2014 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 \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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. 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/agent_utils.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"515faf5884ea37ee902d67a0237d758a6ada4159a16768e0554959eb484f2efd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): pkg/channels/onebot/onebot.go:321-327 | pkg/channels/onebot/onebot.go:437-443 | pkg/channels/onebot/onebot.go:548-554 \u2014 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 \u2014 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 \u0060pkg/channels/onebot/onebot.go:321\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/onebot/onebot.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5eb565698aad915b8be83c6a51a0ef15a320db5294f45382bf9dc70ea55b40e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): web/backend/api/models.go:484-490 | web/backend/api/models.go:523-529 | web/backend/api/tools.go:234-240 \u2014 there are 3 copies across 2 file(s) \u2014 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 \u0060web/backend/api/models.go:484\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":484}}}],"partialFingerprints":{"codehealthFindingId/v1":"1071d47f604e43f4105a089605766dc01b25ac942176e1f2da1221b816a462c7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): cmd/membench/llm_client.go:121-127 | cmd/membench/llm_client.go:142-148 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/llm_client.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"38c77cc5a1c3daeb0516e2a43e52aea5d94c7d961823d916136e1ded4f34f869"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/agent/hooks.go:446-452 | pkg/agent/turn_state.go:759-765 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/hooks.go:446\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/hooks.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"c469046c439876a411af1bb835c91a5b8fca8aa2fed230f2eff0120ecabc4d84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/channels/manager.go:1415-1421 | pkg/channels/manager.go:1922-1928 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/manager.go:1415\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1415}}}],"partialFingerprints":{"codehealthFindingId/v1":"58e637d6f1dd0068ec5b80b056fbb15f3f578571f62c59f404848d756b31d4cf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/config/config_struct.go:65-71 | web/backend/api/config.go:586-592 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/config/config_struct.go:65\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config_struct.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"9841149ebe2c00d70e0e6d9247fef9f0f86654408138da5fb8ab209e46c721cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/config/migration.go:217-223 | pkg/config/migration.go:297-303 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/config/migration.go:217\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"66683e6bc4bb1344e6a3f7b641c35d17714e52016d446c002e263ccdfc29c864"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/config/security.go:111-117 | pkg/config/security.go:128-134 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/config/security.go:111\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/security.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"56cc30b2f45d2181f97233e0e45565f9a00c6ee069dfa3826e2b4e72af6e4e1e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/memory/jsonl.go:312-318 | pkg/memory/jsonl.go:861-867 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/memory/jsonl.go:312\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/memory/jsonl.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"b56ea480245683ee0e6e75deee92d37299ea22aa6cdc0ff53a21cd1294f812a6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/migrate/migrate.go:213-219 | pkg/migrate/migrate.go:225-231 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/migrate/migrate.go:213\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/migrate/migrate.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd560718c0465193813a3a6bd24ff68373ac15242c3847eba7eccca11b8f9610"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/updater/updater.go:299-305 | pkg/updater/updater.go:319-325 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/updater/updater.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd19a99a11ea2429fdb3fb0275113b607feaeae94d7a96eaa77c58c3fb043e8e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): web/backend/api/models.go:347-353 | web/backend/api/models.go:483-489 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060web/backend/api/models.go:347\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a0fbaea38efb267fd0ba0c4fd67dfe272fdb0403b3d5082d61173015ed52e6d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/channels/split.go:92-99 | pkg/channels/split.go:115-121 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/channels/split.go:92\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/split.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d7ea0fcffe398cd184401857b074ba607ab2f21767eab375820daba29c7e03c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/channels/wecom/media.go:495-500 | pkg/channels/weixin/media.go:725-730 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/channels/wecom/media.go:495\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 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 \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/wecom/media.go"},"region":{"startLine":495}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cde735f05961e343f27f0dd3b3570a0cc5ed00bf049f4f5e2e058d86ace1c2a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/evolution/runtime.go:1377-1382 | pkg/evolution/runtime.go:1418-1423 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/evolution/runtime.go:1377\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/runtime.go"},"region":{"startLine":1377}}}],"partialFingerprints":{"codehealthFindingId/v1":"16b58aaac5e67082772006abfcee220863f75a60da6c9af9029ff65df4401165"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/seahorse/store.go:1645-1650 | pkg/seahorse/store.go:1675-1680 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/seahorse/store.go:1645\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/seahorse/store.go"},"region":{"startLine":1645}}}],"partialFingerprints":{"codehealthFindingId/v1":"efa553b63b3d48130a7888250a78cb642707ded2fb9e3571abd253f39dfad8a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/tools/cron.go:278-283 | cmd/picoclaw/internal/cron/helpers.go:21-26 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 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 \u0060pkg/tools/cron.go:278\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/cron.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ab1e4ce7f2d006e678219334a6a59cfd71a3c66acfd29fa1e8f5772029d7aeb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): web/backend/api/auth.go:150-155 | web/backend/api/auth.go:293-299 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/auth.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"56bb26da9ef55db6f70a2d6113ec2010e6a982846e87562ca3f7a51a17497d4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): cmd/membench/main.go:63-68 | cmd/membench/main.go:96-101 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/main.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"8422a10598a73d22f37e7028f01ced7197e5a04442552c3bf7feddcc73abfaf5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): cmd/membench/eval_llm.go:162-166 | cmd/membench/eval_llm.go:178-182 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/membench/eval_llm.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"b95e02db5a6d041ee4d4de646949d25b2dd510c903f581d3e9806af89cffcbb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/evolution/organizer.go:184-188 | pkg/evolution/runtime.go:1318-1322 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/evolution/organizer.go:184\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/evolution/organizer.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"01ebf743c0ad3ffae78f9d2d9714a404e880a63eda8af4e6fc5c20390250514f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/gateway/gateway.go:446-450 | pkg/gateway/gateway.go:694-698 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/gateway/gateway.go:446\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/gateway/gateway.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b53ac2a5f786af6a454d51f7dc63a01f757be535e5d6f3336fa4527e1884eee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/agent/pipeline_setup.go:40-44 | pkg/agent/pipeline_setup.go:85-90 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/agent/pipeline_setup.go:40\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_setup.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"58be30cbc722637ef1a9d2e4c72fd0263e6814d146067dd84a4883eedc1971ba"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/agent/pipeline_llm.go: pkg/agent/pipeline_llm.go changed 13 times in last 90 days, max complexity 103. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_llm.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef3aa942bebfa363baf4a525dc2f77571ca5938075cb3bb87fad8cc5a6771f56"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/config/config.go: pkg/config/config.go changed 17 times in last 90 days, max complexity 39. 7 of those changes were fix/bug commits, and the other 10 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d5ee4b2685dc7ea715301363f8207ea775818d15189560f1d72c1b25d1cd22b"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/providers/openai_compat/provider.go: pkg/providers/openai_compat/provider.go changed 17 times in last 90 days, max complexity 37. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/openai_compat/provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db8ffadfe2ac49fa580f782e2a3c2dd99d7c6066823671213a46330d7352f8d"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/agent/pipeline_execute.go: pkg/agent/pipeline_execute.go changed 4 times in last 90 days, max complexity 112. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/agent/pipeline_execute.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1ffdae7ad78c2001d1b6c2ff5b0e4c6f37e5066155b2a123344f69e1271ecbb"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/tools/integration/web.go: pkg/tools/integration/web.go changed 10 times in last 90 days, max complexity 43. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/integration/web.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cae41d34b992dfdea0bfc630e3a2e707fd23161b7a2e1dc466a774b67fe9af8d"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/tools/shell.go: pkg/tools/shell.go changed 11 times in last 90 days, max complexity 36. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/shell.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"42749762919b3defa97e8c865f7ef6dab305dda52f7438d36ecd6166e58f455c"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/providers/factory_provider.go: pkg/providers/factory_provider.go changed 6 times in last 90 days, max complexity 56. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory_provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaace564f2c0a714192c51925996c0f55fbccf122c00b6c7c3a46e0053e3364e"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/tools/fs/filesystem.go: pkg/tools/fs/filesystem.go changed 7 times in last 90 days, max complexity 39. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tools/fs/filesystem.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1a492f085a949510abfe2e55f77f2b88510f2628e7e36d8702b4a22f4094b2b"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/channels/manager.go: pkg/channels/manager.go changed 7 times in last 90 days, max complexity 38. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/channels/manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae7122016811f351d7f29aa9d64bf1de058e31f4fa569d17c534588f7a909813"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/frontend/src/components/models/edit-model-sheet.tsx: web/frontend/src/components/models/edit-model-sheet.tsx changed 7 times in last 90 days, max complexity 35. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/frontend/src/components/models/edit-model-sheet.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bde24d457de8fed5d056b3449b1965571c25583ecd52927db4010e027b295e80"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: pkg/netbind/netbind.go, web/frontend/src/components/chat/message-code-block.tsx, pkg/utils/http_guard.go, web/frontend/src/components/chat/message-code-block.utils.ts, pkg/tools/shared/result.go, web/frontend/src/features/chat/detail-visibility.ts, pkg/tools/hardware/i2c.go, pkg/tools/hardware/spi.go (\u002B8 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"c1cd78dceaf0408dfff1bce3ef2ccdcc3540603056a368ad8b9377fdb1bcb6c5"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #2: If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: pkg/agent/runtime_event_logger.go, pkg/channels/split.go, pkg/config/legacy_bindings.go, pkg/session/key.go, pkg/session/allocator.go, pkg/channels/wecom/protocol.go, pkg/events/bus.go, pkg/channels/qq/audio_duration.go (\u002B3 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ea1501920454800e6c3855c3d6e17e7a7f107a83c98b5c881e5095133e43a399"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #3: If anonymized user #3 becomes unavailable, 9 significant file(s) lose their only recent owner: pkg/providers/common/google_schema.go, cmd/picoclaw/internal/mcp/helpers.go, pkg/config/diagnostics.go, pkg/utils/markdown.go, cmd/picoclaw/internal/mcp/add.go, pkg/agent/discovery.go, pkg/agent/tool_allowlist.go, pkg/tools/shared/diff_result.go (\u002B1 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"160da0d5c9fc2fbcf3e2ac444c797f80ca3133a937bd08b6b49a6d13aac2d299"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #4: If anonymized user #4 becomes unavailable, 9 significant file(s) lose their only recent owner: web/frontend/src/components/channels/channel-forms/wecom-form.tsx, web/frontend/src/components/agent/tools/tool-library-tab.tsx, web/frontend/src/components/agent/skills/use-skills-page.ts, web/frontend/src/components/agent/hub/use-hub-marketplace.ts, web/frontend/src/components/agent/skills/filter-bar.tsx, web/frontend/src/components/channels/channel-forms/discord-form.tsx, web/frontend/src/components/channels/channel-forms/slack-form.tsx, web/frontend/src/components/logs/logs-panel.tsx (\u002B1 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"79a7d56def57ce60123731690e19e465d91ada45015a1fee78de8c86296f17c2"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #5: If anonymized user #5 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/routing/features.go, pkg/routing/classifier.go, pkg/tools/delegate.go, pkg/routing/router.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"cb6f337a390ee0cd98d7577bf8302af234f5e110ecaeabab9ce1487c486494d3"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #6: If anonymized user #6 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/tools/hardware/serial.go, web/frontend/src/components/models/test-model-dialog.tsx, pkg/tools/hardware/serial_unix.go, scripts/copydir.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"b825bec66683e1e7bdbd786195539628236937d9ae201df25c675c704c96cc57"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 11 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold \u2014 folded into the bus-factor score and metrics (67 single-owned of 411 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #7 (3 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)) (\u002B5 more) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d5b8f11381d61a58459ffc7c595fd52d09c03c711894a63a9578043d2338412b"},"taxa":[{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4d621ca81910dd86b411e052daa24cd58341b71794022b0289cabd89c2eca319"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"25254c97b62b13b7c073eeeb90b462ffec833e325034c0621142898ae58e024f"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c4d2b670254bdd235733b2a63edd2f78184944739589dc19e542df937a8f37f2"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e5ca754fd6a271de3211da2bac61bcd41736fcbc239dcd9380fc3b953ab2fed8"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9de1a614fb03c483fea12920a3f17b33e3e56bb89045569f130a71e1602c8934"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4ae50138ee213d9ed224c67bd3fc3fb8a86023133f3c2919cd63a458cb5b9dca"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"abb5a7d5ac019fd14374b44fc9fcd276ecf2b45797b2aaaffe720f23403fe403"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2cd32cde40db336e1ce1cb3c5818a8e577d10ea7571d11504f2c78e0d1de5699"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9443d995ce53b5769565c61b4912e36ebfd029801a50ae1887b140e3fad9a99f"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1fd0b7e98e975a3e88bf255599d9b5d24ac98154e91fb73dc80a4adb1f6769c6"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a0c2ff969236f5ef9ff9d94232f6a85a657fe1b3ff03f5c63100b0aae5cfd654"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c2e5b69cac6b95cadfd372d3bf7cc0906a8086be045a44eb5ddd7ed916317c36"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"71e14e08d60fb13bb644add210191760d0bfb637af2c9d08a5f3c4273df18a51"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9fbecefc6ada11298fa0eb1de925524fc5a3e90cd5322e074e7c5dc578ef0c99"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bc780f1916675f64dcaa42f1e3acd096b157e9a2dba280eb2aa5f9eff72e6bdc"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c4153454eb828dcb7b7e8d15ce02ec0838ad269e6a8aef2cefa8ae66f5edf760"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6638712f9665576767b921853df455d47d51f7fce76c50be68fd54fa99d45971"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f4e6006ce675949aaec5359a7090918ddd74154b479d19d2748b3bbb08914411"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c9d19a7971369a96070a4e5d3de60988bec587c82627a102177e02f9a595f406"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb200840ec636751c0e873226df20ce5f1892a65da6b0e1cd54b5949122e84e9"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"962d4508c509e4f6fde77bbb13184fe39f4858a21e599b3777533a29d8e055e3"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e52a054061905992da13c20d47d1a67eae3ed4d36ef19fa7dc9bf48d4af96ac8"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9dcd86761fd71d326081047f550b241b9f12a8f3bf5e311c25fc1ed410c04293"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f6cab784e8690f3f00505cfa40006c64b282b93dd041e06821005f57679ef84d"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f05ea75fd18181d56454309ca2ebf3c139b8f538ddd2cba106b2940d39fa70a7"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9b1ab09b6bdde0650c9b32bafebc19d2aeb6a2666ac84a0a324e8f553001fbf2"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4fabe75d33397c1efeccff6c67b192c8f53525c41e419609777c100d5c37d92e"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1e4c2fe44ec63e56a652c1817873fa6a701d4dda87adf34d4ab5115d769f4255"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1e6213f37428e4587fe5933f2b6910e10617ece3172b6ac529912b4b7d47e6de"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c6b7bd3afb829cd784c9a8f784d62e3ef152fcd602761acce3330d8bc4044e3c"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"40a7f525a9f890266fe2a318da0f0f78ed408b8bed471874cc858c5b92c17395"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2cd1f9ed756fdaf906a2b2114f49bf80ad4c671663a22eeff7fb00c1db3cd70e"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"949572f8f50c84f14be69864c6ebba3148da956c817251af4c6f9dd352759ff4"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b02ecf04cd4bd42f22c77045089dd6d911d07539f6ab034563edf4e034c7be0d"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f101620779ae88af58251aa17689bf9a25847b9d3f82e2a74da7037c3a829f98"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bd9e59d788b75d8b9d4fbada705a17c833e2de78310064adca510e48a084a6dd"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c15e03ac1fa47e87e1db1facbff939b0109157aa1a15ea9510ba7aa38b6e07cb"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"160f8e4f73e01d60a8b0f3a55ca62cade4ad4cf4c5bac6b888bcc7b6a7289d91"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"47cf4140a6e295af6303a3b3b9a5f4ffa3184b8db82d52b0b6fc27c69c77e344"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"28a11899053da5fc43a6a7748395c49c569e7e52e22767b3c92502822d8944c7"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"dc808bb3a53db34d256527d3d39e8cc4bff9afdd1f79c1cd484a5c27bdd1a4ce"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b8ef127ba62dcf31e079a1ee0f8d2ffdfc288d7913c0d81a41e410f96c3158cb"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a8b744797e7311e0706c205d8828838811d9dacc81737623c6f4aefe7385a86a"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bf316118ebf549747fa8fc9ccce4271e3ef9ab61a5c10bd82c160ff28c127899"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"cdbec602078e3c4ad4c341a49c4f169fa84ff3b8fac6acdd00f5eccb4bdef7bf"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e92d01e4e52f9bb4228f8f21026af6cbdd1bfa217b0a4eb7792ffc1cd13ca2d5"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"fd34071f0a37397b22950926e6e7d533f19a1ab2e35c80a3ec230eef7195ce4c"},"taxa":[{"id":"CWE-250","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ab8d83539c5ebe567cb6deae98d392d6617f9ea4001a34a9a21fb3f393c0be8f"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"81bd5176a15ccff67a729ef95262a7ae5c48495816679550e8b13152a4c2caed"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f9deb0b3e9568df1171bacf908174d514cb7e71041f1c1975b38340d1bde8fc0"}},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f79a095d7c5b7056820e72c3e1c6028b29d37746ce7746a31faf3a2f9da38540"}},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bb28c99a842537dac25d16ba4837e2bafa0ec95e00b3a7a9e1a16d08f5064b8c"}},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d65659c44cc3e7c51164dae9527e51806ec75c89c873ee174c3d9e01dbd9dde9"}},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a7dd4ea6cbc26df15897071342bf88ca132d072ae9886def184132ae631b828b"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e72d1e72fc5b9be924e5486d0578cc8f38ead000862924d243026fb8408cd320"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"728f59ffbe091e159e34c07a9cbdcb3e37b7812590278a107d76e3d6a16ba014"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3770ede0bc725241b5959127b5dd42bb1edd74899a769badb3595f9b3288e528"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b05c8439a91aab7c164080dd34c0e3f9be6e4c9502ea409271072ed6884f0516"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"48a0b844a571488a1061f06f389d492a2c0f650679681fbdf2220a1b45bd22b4"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"fd7d69d965329207925987b0433ad6f2eec35fc58ff4c6e7e68938b274684080"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 21 of 411 analysed file(s) have no living knowledge left \u2014 their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each \u2014 largest first: pkg/skills/registry.go, pkg/audio/asr/whisper_transcriber.go, cmd/picoclaw/internal/cliui/help_cmd.go (and 18 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ce861fd78f6935114d3a342cb90ad25870f984e1042954fcbbe27c0e23be3658"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: config.go \u2194 models.ts: \u0060pkg/config/config.go\u0060 and \u0060web/frontend/src/api/models.ts\u0060 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit \u2014 they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary \u2014 an event or message name, a route, a serialised shape \u2014 that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other\u0027s build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd780d77521d8429c28ce1b6a0eae6604c024e8dd91536dfc88fe41278816b56"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: factory.go \u2194 provider.go: \u0060pkg/providers/factory.go\u0060 and \u0060pkg/providers/openai_compat/provider.go\u0060 change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2a1afbfc439517308830179d66a6d6ff754c9e9e1043f915b9486b4b1fab4f5"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: factory_provider.go \u2194 models.ts: \u0060pkg/providers/factory_provider.go\u0060 and \u0060web/frontend/src/api/models.ts\u0060 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit \u2014 they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary \u2014 an event or message name, a route, a serialised shape \u2014 that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other\u0027s build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/providers/factory_provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"451eecb78982328570d01336f929d9b10cc9a06a348b2a9b92965d2511da4d70"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: config.go \u2194 factory.go: \u0060pkg/config/config.go\u0060 and \u0060pkg/providers/factory.go\u0060 change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"67df5f61d060c74765caec27709864846f5542068c03d355ddfb2aef2a8d9f13"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: models.go \u2194 edit-model-sheet.tsx: \u0060web/backend/api/models.go\u0060 and \u0060web/frontend/src/components/models/edit-model-sheet.tsx\u0060 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit \u2014 they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary \u2014 an event or message name, a route, a serialised shape \u2014 that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other\u0027s build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/backend/api/models.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d46c41aa3918252478745c0938704817fef5d1b6c4acd79f2d5cee8c7e4b8f7c"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: migration.go \u2194 factory.go: \u0060pkg/config/migration.go\u0060 and \u0060pkg/providers/factory.go\u0060 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) with no explicit dependency \u2014 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 \u2014 the registration is the link, and it is meant not to be an import \u2014 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/migration.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"59890e7659fe63383be5a5a93c3fb7483b2a141d72dc928aeae2554280078b43"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0e17f71490e4d120a48b2b2881ab866c93b272bef2febb673a3e8e42b2c288ab"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0752d0df7434000fcabf1048e2de30a7a1a8b982b3db9a19898c4dec199856b4"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c3101d36131a52584dde37b042bdfe9fc6a1d1edad6398c91ef166385743b007"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"50c379534161bb30611d421e82af3666b891a67b9a6a35df5a4fc4b4977e653b"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"94e02eea5764fec7c68881dfaf08794994cb5f5915475658189d0ffad65d6e22"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1032","guid":"5f21e517-68aa-a650-9a25-5771ef024637","name":"OWASP Top Ten \u2014 Security Misconfiguration category","shortDescription":{"text":"OWASP Top Ten \u2014 Security Misconfiguration category"},"helpUri":"https://cwe.mitre.org/data/definitions/1032.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-16","guid":"659db3ea-affc-8453-8add-c1218fbfcb92","name":"Configuration","shortDescription":{"text":"Configuration"},"helpUri":"https://cwe.mitre.org/data/definitions/16.html"},{"id":"CWE-250","guid":"52ee12e8-390a-7351-b1e6-388afa694e54","name":"CWE-250","shortDescription":{"text":"CWE-250"},"helpUri":"https://cwe.mitre.org/data/definitions/250.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"CWE-353","shortDescription":{"text":"CWE-353"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-732","guid":"1da27e8f-b330-7650-ab63-bd61953eae5d","name":"Incorrect Permission Assignment for Critical Resource","shortDescription":{"text":"Incorrect Permission Assignment for Critical Resource"},"helpUri":"https://cwe.mitre.org/data/definitions/732.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"CWE-829","shortDescription":{"text":"CWE-829"},"helpUri":"https://cwe.mitre.org/data/definitions/829.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":69,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}