{"$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":"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":"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":"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":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"]}},{"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":"boot.build (cyclomatic 310): boot.build has cyclomatic complexity 310 (threshold 15). Of this number, 183 points are the body\u0027s own statements and 127 belong to 28 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":"internal/boot/boot.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"e91e84fcfd7c7cacbc66d101e498ee0aa273125a43c56858c152d5cce4a1e408"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.update (cyclomatic 252): chatTUI.update has cyclomatic complexity 252 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/cli/chat_tui.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef0bac6a838c25b687d2fdaef4a20720f03239b9ecb3a8453dc4adcba22d3608"}},{"ruleId":"D1","level":"warning","message":{"text":"config.RenderTOMLForScope (cyclomatic 152): config.RenderTOMLForScope has cyclomatic complexity 152 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/config/render.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ab17991e688d04c41d2367f281064d4a4df4a3d7bf67bd7fa5f866d120f5316"}},{"ruleId":"D1","level":"warning","message":{"text":"config.RenderTOMLProjectDelta (cyclomatic 148): config.RenderTOMLProjectDelta has cyclomatic complexity 148 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/config/render.go"},"region":{"startLine":817}}}],"partialFingerprints":{"codehealthFindingId/v1":"e81ea7b70488564b9cfe3e959c32869ad354f7b977d179dbcf52609809032f90"}},{"ruleId":"D1","level":"warning","message":{"text":"BotGateway.handleSlashCommand (cyclomatic 84): BotGateway.handleSlashCommand has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/bot/gateway.go"},"region":{"startLine":1332}}}],"partialFingerprints":{"codehealthFindingId/v1":"caccace9004acf943600ee024b1af1dd1201319ae756492569ddf1ca3af4e460"}},{"ruleId":"D1","level":"warning","message":{"text":"client.readStream (cyclomatic 84): client.readStream has cyclomatic complexity 84 (threshold 15). Of this number, 76 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":"internal/provider/responses/responses.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4cc1d9fe93f3d6c012eaa743d46a2171fab0d7724675a8c5ab4be9ef4471d10"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.rollbackPendingUpdateMatchingLocked (cyclomatic 78): repair.rollbackPendingUpdateMatchingLocked has cyclomatic complexity 78 (threshold 15). Of this number, 72 points are the body\u0027s own statements and 6 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":"internal/repair/update.go"},"region":{"startLine":2443}}}],"partialFingerprints":{"codehealthFindingId/v1":"54f325f8a72587651afeeaab3bdcf8ee9eb15b9941a8894c9076e7025d7a0f2c"}},{"ruleId":"D1","level":"warning","message":{"text":"App.buildTabControllerWithContextAdmissionHeld (cyclomatic 74): App.buildTabControllerWithContextAdmissionHeld has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent 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":"desktop/tabs.go"},"region":{"startLine":3567}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad1aa3900d738c45a75c093a667927bf21009b71e5d453b9e817704d54a8d65a"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.selectMany (cyclomatic 73): cli.selectMany has cyclomatic complexity 73 (threshold 15). Of this number, 59 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":"internal/cli/select.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"29001ddc6c43a9b135aa21f7f34487d5ff05c238cf34bcb66ded55a4213425cf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.runMacUpdateHandoff (cyclomatic 72): main.runMacUpdateHandoff has cyclomatic complexity 72 (threshold 15). Of this number, 48 points are the body\u0027s own statements and 24 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/updater_mac.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dffb80b94e18b34104af3ce8914e711e22ab7f7f83ebfe92bd5d92bd743674e"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.restoreReleaseUnit (cyclomatic 72): repair.restoreReleaseUnit has cyclomatic complexity 72 (threshold 15). Of this number, 70 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":"internal/repair/update.go"},"region":{"startLine":2784}}}],"partialFingerprints":{"codehealthFindingId/v1":"60f0a473e4d842156a6eae878e26d7cc94e7baed1c5b4a6995d2f68ba19b2da7"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.runSlashCommand (cyclomatic 66): chatTUI.runSlashCommand has cyclomatic complexity 66 (threshold 15). Of this number, 65 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":"internal/cli/chat_tui.go"},"region":{"startLine":4528}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b9e283f7b7ea1544385302e202ca71ee21859cb6ac94ceb5a45d54046090d13"}},{"ruleId":"D1","level":"warning","message":{"text":"App.rebindTabToLoadedSessionPath (cyclomatic 61): App.rebindTabToLoadedSessionPath has cyclomatic complexity 61 (threshold 15). Of this number, 58 points are the body\u0027s own statements and 3 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":"desktop/app.go"},"region":{"startLine":4155}}}],"partialFingerprints":{"codehealthFindingId/v1":"f444424c29aa864c233ceb96f9170e921744953068caff6621bce52f0a0bcff2"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.chatREPL (cyclomatic 61): cli.chatREPL has cyclomatic complexity 61 (threshold 15). Of this number, 52 points are the body\u0027s own statements and 9 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":"internal/cli/cli.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ac7d1814f62d5a7678dcc41b800ead2bfaf15c95a0bad7221ca122f4fc2f183"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.ingestEvent (cyclomatic 61): chatTUI.ingestEvent has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":4250}}}],"partialFingerprints":{"codehealthFindingId/v1":"af5e013145783a8a71911d541a7c52b837ff3976f8ca84c819b734ce43e0d467"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.runAgent (cyclomatic 59): cli.runAgent has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/cli/cli.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"0519d0f862d61655bfab8bbc480c671e259a8d9f5bc40912c6b09a50ef716065"}},{"ruleId":"D1","level":"warning","message":{"text":"client.readStream (cyclomatic 59): client.readStream has cyclomatic complexity 59 (threshold 15). Of this number, 52 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":"internal/provider/openai/openai.go"},"region":{"startLine":909}}}],"partialFingerprints":{"codehealthFindingId/v1":"600c18c10c1de7a8f5c6f6baf2a8de82395e6f466fe9d8f63d7300d3ccd6a5c4"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.migrateLegacySessionsWithMarkers (cyclomatic 57): agent.migrateLegacySessionsWithMarkers has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/agent/migrate.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ed74992af4de3f7db5f93c356e655abb069d6595dbd5ef1a8bcf50c98abacbf"}},{"ruleId":"D1","level":"warning","message":{"text":"TaskTool.RunProfileSpec (cyclomatic 55): TaskTool.RunProfileSpec has cyclomatic complexity 55 (threshold 15). Of this number, 43 points are the body\u0027s own statements and 12 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":"internal/agent/task.go"},"region":{"startLine":809}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b373ba7ee61ab7fe3d9d68e2fb6ca876b0f2fb648e8fca0215f4140ce1f138d"}},{"ruleId":"D1","level":"warning","message":{"text":"client.readStream (cyclomatic 55): client.readStream has cyclomatic complexity 55 (threshold 15). Of this number, 47 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":"internal/provider/anthropic/anthropic.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3d5292509746b67ad6bef7358bb0532b5071de11c19f4692dee16d5bf5a3df9"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.finalReadinessCheckFor (cyclomatic 54): Agent.finalReadinessCheckFor has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/agent/agent.go"},"region":{"startLine":1615}}}],"partialFingerprints":{"codehealthFindingId/v1":"422ca342b558bcc1822e262db8523a900e24b3a374b3f9c9c2f57985c4414076"}},{"ruleId":"D1","level":"warning","message":{"text":"main.desktopBotConfigConfigured (cyclomatic 52): main.desktopBotConfigConfigured has cyclomatic complexity 52 (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":"desktop/settings_app.go"},"region":{"startLine":1595}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f79d35f75bf47433015135953e71af4b12ad4f1ca0333c146787ae8638da955"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.UndoLastRepair (cyclomatic 52): repair.UndoLastRepair has cyclomatic complexity 52 (threshold 15). Of this number, 38 points are the body\u0027s own statements and 14 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":"internal/repair/transaction.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"566fbbb94b6b76f551cbad96fec13fda1f066d3720e7d832d36f448523be23b7"}},{"ruleId":"D1","level":"warning","message":{"text":"openai.New (cyclomatic 51): openai.New has cyclomatic complexity 51 (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":"internal/provider/openai/openai.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"3926bd788c4931e150fd040772f96b7d517b6ac8e5b7c6bb62e849425810f8cf"}},{"ruleId":"D1","level":"warning","message":{"text":"ControlService.controlOp (cyclomatic 51): ControlService.controlOp has cyclomatic complexity 51 (threshold 15). Of this number, 49 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":"internal/taskmonitor/control.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"90d1909e8a03c77147d02ee71334772233fde59b1ed7971f5653d2c30114be3b"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.stream (cyclomatic 50): Agent.stream has cyclomatic complexity 50 (threshold 15). Of this number, 41 points are the body\u0027s own statements and 9 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":"internal/agent/agent.go"},"region":{"startLine":2880}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa0d9346a48e765e16a3b15250c97ad8326ad16abb9aa730a05b581f7283d56c"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.executeBatch (cyclomatic 50): Agent.executeBatch has cyclomatic complexity 50 (threshold 15). Of this number, 30 points are the body\u0027s own statements and 20 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":3213}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cf27abbfa16d7f3dce9bc7ea5d1bd19985d7c674d6dc7181b4c8ff78effd060"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.selectOne (cyclomatic 49): cli.selectOne has cyclomatic complexity 49 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 13 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":"internal/cli/select.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad8cc5fec5fa23bdff376235dc19e8b88d0e6ebd171e23b324479a46d09de64b"}},{"ruleId":"D1","level":"warning","message":{"text":"Session.checkSnapshotWrite (cyclomatic 48): Session.checkSnapshotWrite has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/agent/save.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd0b002c2bb5cdc3081f94d9139b7112673dc05082532e3474fafe0f9f15547a"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.botDoctor (cyclomatic 48): cli.botDoctor has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/cli/bot.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"761b049b8ee5244fdeef38352dfde6bfe4c5b84eced44a0312a39e360f5130ba"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.readOnlyExecutionBlock (cyclomatic 47): Agent.readOnlyExecutionBlock has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/agent/agent.go"},"region":{"startLine":3864}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c909d3b9a9d7631bc64ba749d0b3ffb32bcdb007bdbaf71b30cbed0fec57ad7"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.SaveWithOptions (cyclomatic 47): Store.SaveWithOptions has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/memory/store_v2.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bdadfc03e40ff5e6d83fad12e0879834fd2272d3fe616759260e6cb369c2483"}},{"ruleId":"D1","level":"warning","message":{"text":"client.buildRequest (cyclomatic 47): client.buildRequest has cyclomatic complexity 47 (threshold 15). Of this number, 44 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":"internal/provider/anthropic/anthropic.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca13426c9f5f8f7ad7a625d0d879998f1effeb0105dd1bb88c8dba908f5b168b"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateUpdateTransactionForLauncher (cyclomatic 47): repair.validateUpdateTransactionForLauncher has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/repair/update.go"},"region":{"startLine":3115}}}],"partialFingerprints":{"codehealthFindingId/v1":"1006b6a3d39d70cdbfd446f87387db8ec09f5293ecd53ddec4896a4707e06f63"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.handleMCPManagerKey (cyclomatic 45): chatTUI.handleMCPManagerKey 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":"internal/cli/mcp_manager.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe136c268430a1c64c5e91f184fa22de4a444b14ba96da1d8608a7f61b6d7d88"}},{"ruleId":"D1","level":"warning","message":{"text":"hook.claudeFacingToolInput (cyclomatic 45): hook.claudeFacingToolInput 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":"internal/hook/hook.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d83dbce7ca1a3c8ecd1ac74b14b689cbed815d5f6e81b850d75ef5a75864c79"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.commandFieldsHighRisk (cyclomatic 45): recovery.commandFieldsHighRisk has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \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":"internal/recovery/rules.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9dff2855239ba62fbe6be8baf96262b051284335baa423095f983eac1bf138a"}},{"ruleId":"D1","level":"warning","message":{"text":"Session.save (cyclomatic 44): Session.save 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":"internal/agent/save.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3a8f8040b8d0e7a4191e3e6172466fe39b3a02d90184ee9b329f4682ad5432f"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.compensatePublished (cyclomatic 44): Store.compensatePublished 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":"internal/checkpoint/transaction.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"46250d074248b1aa41c06569bbf300342d4225a522dce7b6fdfc1f9e8cf1d4f0"}},{"ruleId":"D1","level":"warning","message":{"text":"client.buildRequest (cyclomatic 44): client.buildRequest has cyclomatic complexity 44 (threshold 15). Of this number, 43 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":"internal/provider/openai/openai.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed3ee0b9981daed93a23d3834da5aa79c55194658691537fd679a5bc07e5b895"}},{"ruleId":"D1","level":"warning","message":{"text":"main.historyMessagesWithPlannerDisplaysAndLookups (cyclomatic 43): main.historyMessagesWithPlannerDisplaysAndLookups 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":"desktop/app.go"},"region":{"startLine":5861}}}],"partialFingerprints":{"codehealthFindingId/v1":"d52de3977f09be8ae9c394aad3d34525114528da745fe9fc1befc27694067c38"}},{"ruleId":"D1","level":"warning","message":{"text":"App.ListProjectTree (cyclomatic 43): App.ListProjectTree has cyclomatic complexity 43 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 17 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":7715}}}],"partialFingerprints":{"codehealthFindingId/v1":"9247a8459a843908a1c2caaa8cc38588e848ccb0783d0f2b042c4a438fe3c9a9"}},{"ruleId":"D1","level":"warning","message":{"text":"Session.saveRecoveryBranch (cyclomatic 43): Session.saveRecoveryBranch 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":"internal/agent/save.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"481f87b632f9a0b9577272d0df9d5b89f263e272be3072d02e914fcc3f042b60"}},{"ruleId":"D1","level":"warning","message":{"text":"main.sanitizeRemoteMarkdownSVG (cyclomatic 42): main.sanitizeRemoteMarkdownSVG has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/remote_markdown_image.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"57e506f85d5a9ae47ab3dbb8078b3eac180f50fa72ad6c91b6b8d9b7a59725b7"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.inspectAndRepairConfigUnlocked (cyclomatic 42): repair.inspectAndRepairConfigUnlocked has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/config.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e37e93e7758c1d221cb6dd8f9cb98aa482d6e905a82a1925196768bce9701c8"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.Run (cyclomatic 41): cli.Run has cyclomatic complexity 41 (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":"internal/cli/cli.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"20d33d55fffd07ff59f309e02f8e65e996661276da07281271d8f558e9bcefba"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.submitCommandOrTurn (cyclomatic 41): Controller.submitCommandOrTurn has cyclomatic complexity 41 (threshold 15). Of this number, 34 points are the body\u0027s own statements and 7 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/controller.go"},"region":{"startLine":1367}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ccfdbebcf10d55c56c62a81f578f15f2bae0920b5625abc49c54aa4f43ee24c"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.runServe (cyclomatic 40): cli.runServe has cyclomatic complexity 40 (threshold 15). Of this number, 38 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":"internal/cli/cli.go"},"region":{"startLine":799}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbc706235a95d56df68bad8a157b7242f60d1c2fa496b725a4809318e35f3acc"}},{"ruleId":"D1","level":"warning","message":{"text":"config.NormalizeEffort (cyclomatic 40): config.NormalizeEffort has cyclomatic complexity 40 (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":"internal/config/effort.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"f49437284efd7cea5814aec28ccb8f6dfc0fd2940df7932c0d019ebcf06b1eb4"}},{"ruleId":"D1","level":"warning","message":{"text":"goalMachine.advance (cyclomatic 40): goalMachine.advance has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/goal.go"},"region":{"startLine":504}}}],"partialFingerprints":{"codehealthFindingId/v1":"083fac02fba8da99e6a11336d31169722212c547810b9010c26eef5d7d83e14f"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.bashSegmentIsVerification (cyclomatic 40): evidence.bashSegmentIsVerification has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/evidence.go"},"region":{"startLine":1904}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bda074f2243e4b3813c5f4e6cc36542a3bcc28880ecb49878304e05cb0699f4"}},{"ruleId":"D1","level":"warning","message":{"text":"App.SaveThemePack (cyclomatic 39): App.SaveThemePack 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":"desktop/theme_app.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cbf7b85d889deb3cec793bfd3d8fef73c2c2e2a33acf06c43006044316d6d35"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.CommitFileRevert (cyclomatic 39): Store.CommitFileRevert 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1620}}}],"partialFingerprints":{"codehealthFindingId/v1":"21af5ada5fa1ac9f2458a7e525bec46c7858c8beb6ce296bfd3a11e5890c7ce1"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.planClaudeMarketplace (cyclomatic 39): installSourceTool.planClaudeMarketplace has cyclomatic complexity 39 (threshold 15). 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, separate the cases: extract each independent 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":"internal/installsource/plugin_package.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"526ca853336e66db4aa43c1cefcb9581940fc2ee4de2308114ae0b30e43cb29f"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.restoreConfigSnapshotBoundUnlocked (cyclomatic 39): repair.restoreConfigSnapshotBoundUnlocked 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":"internal/repair/snapshot.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9525b14839c7cf7f26cf8eeb8e393660cc3858bd587012210c68eceefe9e795"}},{"ruleId":"D1","level":"warning","message":{"text":"secrets.redactKeyValues (cyclomatic 39): secrets.redactKeyValues has cyclomatic complexity 39 (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":"internal/secrets/redact.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbd8a5a15d9c123917dab1ccadd25cd91b7046c98fc685b30b695be5c4ef7fc2"}},{"ruleId":"D1","level":"warning","message":{"text":"main.repairIndexedSessionTopics (cyclomatic 38): main.repairIndexedSessionTopics 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":"desktop/tabs.go"},"region":{"startLine":6645}}}],"partialFingerprints":{"codehealthFindingId/v1":"beebf40afd4f01a8bb8eff779f6afe37c1793667aebfcdee3b330f95b1be00e4"}},{"ruleId":"D1","level":"warning","message":{"text":"App.RemoveWorkspace (cyclomatic 38): App.RemoveWorkspace has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 7 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 5292). 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":"desktop/app.go"},"region":{"startLine":5278}}}],"partialFingerprints":{"codehealthFindingId/v1":"f86d866472770ad02b72e7d2c4b55adbab37b4c3c2246f6ee6718a45168f9d2d"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.parseMCPAdd (cyclomatic 38): cli.parseMCPAdd has cyclomatic complexity 38 (threshold 15). Of this number, 34 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":"internal/cli/mcp.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f9d93dc37b7a3361709f3b75182385dd3feb665d7e2cb299c3652af37121e91"}},{"ruleId":"D1","level":"warning","message":{"text":"control.DecidePlannerRoute (cyclomatic 38): control.DecidePlannerRoute has cyclomatic complexity 38 (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":"internal/control/planner_gate.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"0daef548db96da01958eb19fa36baded9b4c37128202d113b5cddda58785fb9e"}},{"ruleId":"D1","level":"warning","message":{"text":"installlayout.ActivateVersion (cyclomatic 37): installlayout.ActivateVersion has cyclomatic complexity 37 (threshold 15). Of this number, 33 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":"internal/installlayout/activate.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bcc4601c192ef0efd23e85537ad3b5e091c2b8a93f22b8b05ef9e1890b7105f"}},{"ruleId":"D1","level":"warning","message":{"text":"App.SetModelForTab (cyclomatic 36): App.SetModelForTab has cyclomatic complexity 36 (threshold 15). Of this number, 34 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":"desktop/app.go"},"region":{"startLine":9950}}}],"partialFingerprints":{"codehealthFindingId/v1":"b146c1f380873809c6c0f1a1241b15f94dbaabd85fea3590a2e7123c3597b75c"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.beginRunTurn (cyclomatic 36): Agent.beginRunTurn has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/agent/run_loop.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"915b610e6c2484d4445e90c30ea746a4c66c31fa3f066ca1f6d6015ba51e07b7"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.recoverTransactions (cyclomatic 36): Store.recoverTransactions has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1194}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fdcbf575b9708eb4dc6407fb92aef259e7a936612599a9cf7d587bd2c851096"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.applyPlanModeAndProxy (cyclomatic 35): Agent.applyPlanModeAndProxy has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/execute_one.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"757e1c96a63b5ca7dea253e74e19555510b9749c46a89afb201e76afa91abcdf"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.Update (cyclomatic 35): chatTUI.Update has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":876}}}],"partialFingerprints":{"codehealthFindingId/v1":"69e226f6bc929d2967e71a64bcbe67c50d1799b212df140844fc27efaf5eede6"}},{"ruleId":"D1","level":"warning","message":{"text":"App.ensureTabControllerWorkspaceAdmissionHeld (cyclomatic 34): App.ensureTabControllerWorkspaceAdmissionHeld has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":1653}}}],"partialFingerprints":{"codehealthFindingId/v1":"078ca124efd9a801a007c7853f9468eebbe2ffb66a8ef685292edc4ab4b1ffad"}},{"ruleId":"D1","level":"warning","message":{"text":"App.attachExistingSessionRuntime (cyclomatic 34): App.attachExistingSessionRuntime has cyclomatic complexity 34 (threshold 15). Of this number, 31 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":"desktop/tabs.go"},"region":{"startLine":804}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccaaaa800b5735e0529c0d1c2712b5ece03033112426ad934dc4ed83f4ac83b2"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.managementNotice (cyclomatic 34): Controller.managementNotice has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/slash.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"64ba36e6296ae8f57a86113f2bad29368ae1158df34371c6bdfce45d243fbcdd"}},{"ruleId":"D1","level":"warning","message":{"text":"turnOrchestrator.runOrchestratedTurn (cyclomatic 34): turnOrchestrator.runOrchestratedTurn has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/turn_orchestrator.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"4baecf72954bf76260d654a487915b92a20e9074c8b6ea6bb4c5bf187b6b0d42"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.commandFieldsKnownSafeMutation (cyclomatic 34): recovery.commandFieldsKnownSafeMutation has cyclomatic complexity 34 (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":"internal/recovery/rules.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"fda5e962978eb8964a85db931357ff4158d7c706e4b1c835364973eff39308e8"}},{"ruleId":"D1","level":"warning","message":{"text":"App.deleteProviderAndRetargetTabs (cyclomatic 33): App.deleteProviderAndRetargetTabs 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":"desktop/settings_app.go"},"region":{"startLine":2992}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c1fb565a1be548c3f57b613b22c8fc0691b2917669ea176fa262a0cda95af45"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.migrateSubDirectory (cyclomatic 33): agent.migrateSubDirectory has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/migrate.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"61f8abc82025c067bdf812ec7a07637cb87238b842e97fb873a60d2b4bf02a3e"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.prepareTransaction (cyclomatic 33): Store.prepareTransaction has cyclomatic complexity 33 (threshold 15). Of this number, 32 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":"internal/checkpoint/transaction.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6eb95d0eeb2e1a93a499f52ea2cb3016684c9794c4b4725c7cce1ab10018d50"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.handleApprovalKey (cyclomatic 33): chatTUI.handleApprovalKey has cyclomatic complexity 33 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 6 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":"internal/cli/chat_tui.go"},"region":{"startLine":3156}}}],"partialFingerprints":{"codehealthFindingId/v1":"994caf6b131e0353bd5348ae1ff11f86d7271197cfaa1e02b75e06273cd28258"}},{"ruleId":"D1","level":"warning","message":{"text":"protocol.validateValue (cyclomatic 33): protocol.validateValue has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/extension/protocol/validate.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"229fc47415959825c246ae4a09d5b3cf3ff07025cc2805c2fafc3a4aaa3ed7c0"}},{"ruleId":"D1","level":"warning","message":{"text":"main.migrateLegacySessionsIntoGlobalTopics (cyclomatic 32): main.migrateLegacySessionsIntoGlobalTopics has cyclomatic complexity 32 (threshold 15). Of this number, 30 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":"desktop/tabs.go"},"region":{"startLine":6480}}}],"partialFingerprints":{"codehealthFindingId/v1":"6404d0e0e7735fd94b8e07b48d41aae3cc1b71835da109181158329a2d3df524"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.normalizeMissingReasoningIncident (cyclomatic 32): agent.normalizeMissingReasoningIncident 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":"internal/agent/reasoning_warn_state.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4935d2abd6978ff07e5d84d0edc9f917aad68e792fdb2746c3c5be0db8f5cda"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.prepareToolExecution (cyclomatic 32): Agent.prepareToolExecution 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":"internal/agent/execute_one.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"26dd402b72d026f33ffdf0d7234aa630da85fc568a35efc576cb1bf2200edf47"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.commitTransaction (cyclomatic 32): Store.commitTransaction 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":"internal/checkpoint/transaction.go"},"region":{"startLine":665}}}],"partialFingerprints":{"codehealthFindingId/v1":"f63380f8d2e74dd02025a22ee0d9d35036f30805eb34a3ef3158c34b1dbdee68"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.View (cyclomatic 32): chatTUI.View has cyclomatic complexity 32 (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":"internal/cli/chat_tui.go"},"region":{"startLine":3310}}}],"partialFingerprints":{"codehealthFindingId/v1":"13957fbed7ca7df291c1e8a5f3bfcab42e605769b3c45153bc15f73342671de6"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.classify (cyclomatic 32): Gate.classify 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":"internal/recovery/gate.go"},"region":{"startLine":803}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1129328473602150c842ee8e057e8df3cd13200faac3921dec88bcb124eb122"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.PublishClaimedFileUpdateMemberExact (cyclomatic 32): repair.PublishClaimedFileUpdateMemberExact has cyclomatic complexity 32 (threshold 15). Of this number, 31 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":"internal/repair/update.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"28fc7418b79f8cb5d8b3129865cae7891ecf392d6aba8247b0089ce4ef47eb76"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.upgradeCommand (cyclomatic 31): cli.upgradeCommand has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/upgrade.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"894c81fa9e2ca06d64a5f4f69001f260c42cea7270b79ff7495976376c48e32f"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.validateManifest (cyclomatic 31): pluginpkg.validateManifest 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":"internal/pluginpkg/pluginpkg.go"},"region":{"startLine":785}}}],"partialFingerprints":{"codehealthFindingId/v1":"64d2e8c70fd7d13bf840577b4104662def4dcc80bc75cc1c68e2eb66bdcee17e"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.ArchiveSupersededPendingAppBundleUpdate (cyclomatic 31): repair.ArchiveSupersededPendingAppBundleUpdate has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 7 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":"internal/repair/update_legacy.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bcd2f83b687048b292ac0bd180f0eebde6e2cf5756421b1191281d523d41b0b"}},{"ruleId":"D1","level":"warning","message":{"text":"App.removeBuiltInProviderAccessAndRetargetTabs (cyclomatic 30): App.removeBuiltInProviderAccessAndRetargetTabs has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent 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":"desktop/settings_app.go"},"region":{"startLine":2859}}}],"partialFingerprints":{"codehealthFindingId/v1":"c828b774a7be7801d72475995eb4edc775c9f69173f0997df35e405da3628bc8"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.deliveryReviewGateFailure (cyclomatic 30): Agent.deliveryReviewGateFailure 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":"internal/agent/capability_gate.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7e353196cf6cdbfd2ecedfd325a635fa328d7370a6cda85e782d38b65b17011"}},{"ruleId":"D1","level":"warning","message":{"text":"ParallelTasksTool.Execute (cyclomatic 30): ParallelTasksTool.Execute has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/parallel_tasks.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"94ab54b8c5b692791679f03c729747cbcefe85c3a992673bcb91adbb36d44476"}},{"ruleId":"D1","level":"warning","message":{"text":"SubagentStore.CleanupStaleRunning (cyclomatic 30): SubagentStore.CleanupStaleRunning 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":"internal/agent/subagent_store.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eaa2cd3511a1b549360ac62d89e957ac2f8549288da89d282a4d7f9f77c9aae"}},{"ruleId":"D1","level":"warning","message":{"text":"main.recordHistoryDisplayEvent (cyclomatic 29): main.recordHistoryDisplayEvent 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":"desktop/tabs.go"},"region":{"startLine":1250}}}],"partialFingerprints":{"codehealthFindingId/v1":"21ca1607d96b720cb2cba58864d959e48e0fdfbbeaaf68d6b8461f8740fa61e9"}},{"ruleId":"D1","level":"warning","message":{"text":"service.rebuildSessionLocked (cyclomatic 29): service.rebuildSessionLocked 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":"internal/acp/service.go"},"region":{"startLine":1705}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d1d46a79ab90db9be704dcb3641a99e8d8e16101ad1b24dfeeb68b2272b2567"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.applyRecoveryAndPermission (cyclomatic 29): Agent.applyRecoveryAndPermission 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":"internal/agent/execute_one.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1bd8d5a9caa7159dab3c669216e4ab50a58a9c5aff46f566387ad1b14871688"}},{"ruleId":"D1","level":"warning","message":{"text":"FleetTool.Execute (cyclomatic 29): FleetTool.Execute has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 3 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":"internal/agent/fleet.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffbe83dc28d287b20bbd14d0d3eb54bc6abd5d10f09220e0ec4a232f7b273ae5"}},{"ruleId":"D1","level":"warning","message":{"text":"renderSink.Emit (cyclomatic 29): renderSink.Emit 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":"internal/bot/render.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"84633a60e1822c899cb21b14087529f43691ae1164eb0ad9f6d1a3ef604573c9"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.handleRewindKey (cyclomatic 29): chatTUI.handleRewindKey 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":"internal/cli/rewind.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"09c99e96683fb10a6e7714d8974cd28e81a420a96305a4865182a4a731857c13"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.stripCancelledVisibleTurnMessagesAfterWithFallbackAt (cyclomatic 29): Controller.stripCancelledVisibleTurnMessagesAfterWithFallbackAt 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":"internal/control/controller.go"},"region":{"startLine":4517}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac71f2eff20b0310584944426de008dc5d4714128918d94dcc6936644e10eb78"}},{"ruleId":"D1","level":"warning","message":{"text":"guardian.renderTranscript (cyclomatic 29): guardian.renderTranscript 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":"internal/guardian/transcript.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"97dae15a23820c6bfbec3825ed2ef2d56148da04029f18b226102d8f7625389f"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.appendInventoryText (cyclomatic 29): pluginpkg.appendInventoryText 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":"internal/pluginpkg/describe.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"e614b63fd22e070a154be2db8b44bac76c39fcdcf16a10197ec5795e2dbe72c2"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.marshalEvidenceWithinBudget (cyclomatic 29): recovery.marshalEvidenceWithinBudget 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":"internal/recovery/reviewer.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f82d0e89d5100e02e3f47f667f21c3a90c2a16d217da8fb609381f1eba54537"}},{"ruleId":"D1","level":"warning","message":{"text":"readFile.Execute (cyclomatic 29): readFile.Execute 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":"internal/tool/builtin/readfile.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"389fdb9fa82ff84cfcb2a84c9c2ab1efa4403067e2710183df6a4fb85cbcef80"}},{"ruleId":"D1","level":"warning","message":{"text":"App.applySessionBindingToTab (cyclomatic 28): App.applySessionBindingToTab 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":"desktop/tabs.go"},"region":{"startLine":4065}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d5e2852056673866a6bd57bac6bb239e5498bd05a284b65b730c17e535718cc"}},{"ruleId":"D1","level":"warning","message":{"text":"service.openExistingSession (cyclomatic 28): service.openExistingSession 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":"internal/acp/service.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d1ca3171928a6e7be654076eb4e010802350ef5cfd9b3f357e0504e59657c9f"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.deliveryCommandStartsAt (cyclomatic 28): agent.deliveryCommandStartsAt has cyclomatic complexity 28 (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":"internal/agent/agent.go"},"region":{"startLine":2200}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbae5153d7aab064bdac2984f27428a687422f7c51df00021b9fd75a69c1a662"}},{"ruleId":"D1","level":"warning","message":{"text":"providerSetupSession.replayOperations (cyclomatic 28): providerSetupSession.replayOperations 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":"internal/cli/setup_manager.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea523436c29fb313934f675cd9fe1520ced678c00c5a708a19254e50b425f53c"}},{"ruleId":"D1","level":"warning","message":{"text":"fileref.Search (cyclomatic 28): fileref.Search has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 88). 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":"internal/fileref/search.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dd86f61c46b0b0b84f43e3da3312656cd9b1603e5b9846227b9db3fcff90bad"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.appendClaudeHooksFile (cyclomatic 28): pluginpkg.appendClaudeHooksFile 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":"internal/pluginpkg/claude_compat.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f626edbcd2983e0371ab09a30945af8db10be4b0d96dd07a80decae1c3b21c8"}},{"ruleId":"D1","level":"warning","message":{"text":"sandbox.resolveShell (cyclomatic 28): sandbox.resolveShell has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 67, 78, 95). 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":"internal/sandbox/shell.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"2683c7e23f25976367e5c83676ae71d2dfb07211cc02383a64ea21a773f2df25"}},{"ruleId":"D1","level":"warning","message":{"text":"App.SetEffortForTab (cyclomatic 27): App.SetEffortForTab 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":"desktop/app.go"},"region":{"startLine":10185}}}],"partialFingerprints":{"codehealthFindingId/v1":"954a0700b1ae136bf4e91917cf9e553b6b10461b528f1d350f2c968fcdefdf1a"}},{"ruleId":"D1","level":"warning","message":{"text":"App.SetTokenModeForTab (cyclomatic 27): App.SetTokenModeForTab has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":10328}}}],"partialFingerprints":{"codehealthFindingId/v1":"86cf88cfa2860b13f986a19f2149d3f3c6c81443c3d34176907dcebff999eb2e"}},{"ruleId":"D1","level":"warning","message":{"text":"App.rebuildSettingTurnLocked (cyclomatic 27): App.rebuildSettingTurnLocked 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":"desktop/settings_app.go"},"region":{"startLine":1784}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad314519b1d1a6f7724d86dde193e19746c1bcce09090026e125ad72b2a2d06f"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.handleToolRound (cyclomatic 27): Agent.handleToolRound 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":"internal/agent/run_loop.go"},"region":{"startLine":574}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ad0d27e82440ab7cbf923752cd27031f784c63a66393f6323b0e0eb39144822"}},{"ruleId":"D1","level":"warning","message":{"text":"TextSink.Emit (cyclomatic 27): TextSink.Emit 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":"internal/agent/textsink.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"3944420ba483283065b8a0c06c696b03998512c2bf37928e80ca9817ac8c6b11"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.modeTagText (cyclomatic 27): chatTUI.modeTagText 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":"internal/cli/chat_tui.go"},"region":{"startLine":4074}}}],"partialFingerprints":{"codehealthFindingId/v1":"6136654912c7c6b1912dcbaeaa9656cfcf6870ff5963d760e783f425aac7adf4"}},{"ruleId":"D1","level":"warning","message":{"text":"doctor.CollectSkillHealthWarnings (cyclomatic 27): doctor.CollectSkillHealthWarnings 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":"internal/doctor/skill_health.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"5af14a52ad4c06cf7ecf8df29cbf2c0339429d7574fb53065cb94dd49a9b8891"}},{"ruleId":"D1","level":"warning","message":{"text":"installsource.parseGitHubRepoSource (cyclomatic 27): installsource.parseGitHubRepoSource has cyclomatic complexity 27 (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":"internal/installsource/plan.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b5351c42bc3d8ed08298659459a2a53de691c9323b6c7ad9eb8f388c4404215"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.applyInstallMCP (cyclomatic 27): installSourceTool.applyInstallMCP has cyclomatic complexity 27 (threshold 15). Of this number, 20 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":"internal/installsource/apply.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8a52b41885daeda80810c5fe8b223f1a30d1445de939e9b2cb654d979279c5"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.gitCommandHighRisk (cyclomatic 27): recovery.gitCommandHighRisk has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/recovery/rules.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4cebd422901e08405b52481ebcab63444e49be1a02970f8abe63ac1d3413a82"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.curlCommandHighRisk (cyclomatic 27): recovery.curlCommandHighRisk has cyclomatic complexity 27 (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":"internal/recovery/rules.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ad43e98b93158cfb4f5ae3ddab89acbdcd1c0e519f986d61f0504621169f400"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateTrashedSessionPath (cyclomatic 26): main.validateTrashedSessionPath 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":"desktop/sessions.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c7b5b223ca7b4c61c4161ee9416639b6df9a98e019338e90dde0575207e1cd7"}},{"ruleId":"D1","level":"warning","message":{"text":"tabEventSink.Emit (cyclomatic 26): tabEventSink.Emit 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":"desktop/tabs.go"},"region":{"startLine":1547}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8d17f4815bf981a52df6ef6213f69a880d8d0892780e80db0e0c7129f9a55b7"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.finishToolExecution (cyclomatic 26): Agent.finishToolExecution 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":"internal/agent/execute_one.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3ea77b4c742bda8cf02e67c8137944a0a5e0b03d9981d2a06699a1b701bb3e"}},{"ruleId":"D1","level":"warning","message":{"text":"capdiag.displayPath (cyclomatic 26): capdiag.displayPath 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":"internal/capdiag/paths.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"d282dceda294b3fd14c510c9669799ace114344bc3c54c25a36e1b382688a39f"}},{"ruleId":"D1","level":"warning","message":{"text":"config.scanTOMLLine (cyclomatic 26): config.scanTOMLLine 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":"internal/config/edit.go"},"region":{"startLine":1958}}}],"partialFingerprints":{"codehealthFindingId/v1":"0171128e57329d99bb0cd1ee2bf0ae3fc7d84374d1998fcb9bd9eebc5c92031b"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.routeCapabilities (cyclomatic 26): Controller.routeCapabilities 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":"internal/control/capability.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"25a0314d0c528eec387ce53290dd4692244216669752c5101d7803c4c693f98d"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.Rewind (cyclomatic 26): Controller.Rewind has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/rewind.go"},"region":{"startLine":258}}}],"partialFingerprints":{"codehealthFindingId/v1":"e94fedb9350f2da1575d5c6d0b5b227cfa5083c6c2981d8ccc1f46baf72f9e9c"}},{"ruleId":"D1","level":"warning","message":{"text":"Policy.DecideSubject (cyclomatic 26): Policy.DecideSubject has cyclomatic complexity 26 (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":"internal/permission/permission.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"a750a86a00b00632746a3b7dbcc2990d2427ed3494735878bdb13161ea9452af"}},{"ruleId":"D1","level":"warning","message":{"text":"client.streamWithPrefixContinuation (cyclomatic 26): client.streamWithPrefixContinuation 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":"internal/provider/openai/openai.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5ee7aa328c75f00f491d41306cf650011e3f84049362895af101892efebcdc5"}},{"ruleId":"D1","level":"warning","message":{"text":"provider.normalizeDraft202012Schema (cyclomatic 26): provider.normalizeDraft202012Schema 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":"internal/provider/schema_dialect.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"0635cea142bd3ebd5a67b8569fbcbb7e2f4c8160ddbbe136356e1e23f4767c77"}},{"ruleId":"D1","level":"warning","message":{"text":"App.mcpServersView (cyclomatic 25): App.mcpServersView 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":"desktop/app.go"},"region":{"startLine":8142}}}],"partialFingerprints":{"codehealthFindingId/v1":"71be51007a3f883edc5c10fd46264b1969693481bbac3b084bab86cfc5b65a8a"}},{"ruleId":"D1","level":"warning","message":{"text":"App.closeTab (cyclomatic 25): App.closeTab 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":"desktop/tabs.go"},"region":{"startLine":3040}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa8e442253bc921ef6e008693d67e41a72e6e01b0840382680e223f47a7f03a0"}},{"ruleId":"D1","level":"warning","message":{"text":"main.loadWindowsStagedReleaseUnit (cyclomatic 25): main.loadWindowsStagedReleaseUnit has cyclomatic complexity 25 (threshold 15). 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, separate the cases: extract each independent 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":"desktop/cmd/update-helper/release_unit.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc67ad2bbc9eb23002e52cd9551734a49bfabd8d28b63de50865a3f8a9ee9988"}},{"ruleId":"D1","level":"warning","message":{"text":"HeartbeatEngine.executeTask (cyclomatic 25): HeartbeatEngine.executeTask 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":"desktop/heartbeat.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd81bc412931401b8784bca35f2184d616d9f46b9bce763025aac795094ab95a"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.observeMissingToolCallReasoning (cyclomatic 25): Agent.observeMissingToolCallReasoning 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":"internal/agent/agent.go"},"region":{"startLine":1388}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d435934822805c2ee59bb9619226ea5a69b4888bc769988cf7b7282af9c5d9a"}},{"ruleId":"D1","level":"warning","message":{"text":"UseCapabilityTool.resolveCall (cyclomatic 25): UseCapabilityTool.resolveCall 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":"internal/agent/usecapability.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"a534b9b98f2f3fa5cdea6898aada9d3e8d8fd7d5cba3ed6b00882b9792ade12f"}},{"ruleId":"D1","level":"warning","message":{"text":"capdiag.redactAbsolutePaths (cyclomatic 25): capdiag.redactAbsolutePaths has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/capdiag/collect.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d37c57d7cfd7eaf3c88403e54d2c9699ef1d08cf037ceb9f8a87b732dfef45f"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.PrepareRewind (cyclomatic 25): Store.PrepareRewind 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":"internal/checkpoint/transaction.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fce351434aed547123a0802cfe0a676bb1a0e08bbd59465318f7db085e6a90b"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.approvalChoiceLabels (cyclomatic 25): cli.approvalChoiceLabels has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":3099}}}],"partialFingerprints":{"codehealthFindingId/v1":"89767f48627c50a9a0393e588e59017ef9ac266e3bcdc1f9e4901f5e4970724f"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.snapshot (cyclomatic 25): Controller.snapshot 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":"internal/control/controller.go"},"region":{"startLine":3965}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c069b76712fd1788bb6b7d23bf71cc65da5a941fb4a59289dcd5003f4fd84e"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.ClassifyMutationRisk (cyclomatic 25): evidence.ClassifyMutationRisk 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":"internal/evidence/risk.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5e48c99e59fd430d94c0d72996da33d9ef032f8fc5e4c7679d02bebb666606a"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.planLocal (cyclomatic 25): installSourceTool.planLocal has cyclomatic complexity 25 (threshold 15). 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, separate the cases: extract each independent 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":"internal/installsource/plan.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"93d6b4982738bf9d1d92ff53d13fe0aa09a04aa776b4a381f333e73c5a1eac71"}},{"ruleId":"D1","level":"warning","message":{"text":"docsTool.search (cyclomatic 25): docsTool.search has cyclomatic complexity 25 (threshold 15). 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, separate the cases: extract each independent 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":"internal/productdocs/docs.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"e098469c5baf7ca4de5e62b70a61bb80980834484063229441d835a71982d8ad"}},{"ruleId":"D1","level":"warning","message":{"text":"client.buildRequestBody (cyclomatic 25): client.buildRequestBody 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":"internal/provider/responses/responses.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"a668fcd17cb342a242d48e95431bedc40af20fadcb5c35203b6f689f2a9e3ca5"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.ValidateRepairPlan (cyclomatic 25): repair.ValidateRepairPlan 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":"internal/repair/plan.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fe63b5c8f3665169aee9c431b1f2f31142d4dd1e0a504425956a3b07aeea107"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.pruneConfigSnapshot (cyclomatic 25): repair.pruneConfigSnapshot 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":"internal/repair/snapshot.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"a78c70bd88fd79db2503cd21042b3c1a2a49e5507d104b18285b544bf22fd8ed"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.RecordClaimedFileUpdateInstalled (cyclomatic 25): repair.RecordClaimedFileUpdateInstalled 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":"internal/repair/update.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5dd64fd696642443b6bc4738ae8b803545ce9901d655983a7801c84577efadf"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.quarantineExistingAppBundleUpdateBackup (cyclomatic 25): repair.quarantineExistingAppBundleUpdateBackup has cyclomatic complexity 25 (threshold 15). Of this number, 22 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":"internal/repair/update.go"},"region":{"startLine":1421}}}],"partialFingerprints":{"codehealthFindingId/v1":"36ea8f11677fc604ce4c225ccbc234b98bcde669bebf12fe7d2f10c0dd48b887"}},{"ruleId":"D1","level":"warning","message":{"text":"readSessionTool.Execute (cyclomatic 25): readSessionTool.Execute 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":"internal/tool/sessiontool/sessiontool.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ca268697feb7a2228462ced30a4c22a0cf209830baf06e3a7160fa965a1a5bd"}},{"ruleId":"D1","level":"warning","message":{"text":"main.writeThemeZip (cyclomatic 24): main.writeThemeZip 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, separate the cases: extract each independent 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":"desktop/theme_import.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"053f48029999b3982bd7974836805b73b93f806b0b807366d34eaf40ee4bc022"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateThemePackManifest (cyclomatic 24): main.validateThemePackManifest 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":"desktop/theme_pack.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"054d89eb5c8169c57589be45bcab4b4771c5d929ff72b0e4426046c5b27f3ec3"}},{"ruleId":"D1","level":"warning","message":{"text":"App.indexedBlankTopicIDLocked (cyclomatic 24): App.indexedBlankTopicIDLocked has cyclomatic complexity 24 (threshold 15). Of this number, 21 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":"desktop/tabs.go"},"region":{"startLine":2887}}}],"partialFingerprints":{"codehealthFindingId/v1":"77c28a4d7fe92ca3b0b56031b253aaccc0dc3f0a55f1a4cc537419b8ec8f72f0"}},{"ruleId":"D1","level":"warning","message":{"text":"main.runInstall (cyclomatic 24): main.runInstall 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":"desktop/cmd/update-helper/main_linux.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"e67ef913bc3a20927e09be77a17fd3f73fa96c617702243c4e737a43ee0a6d0a"}},{"ruleId":"D1","level":"warning","message":{"text":"Coordinator.Run (cyclomatic 24): Coordinator.Run has cyclomatic complexity 24 (threshold 15). Of this number, 19 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":"internal/agent/coordinator.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e7eaebfd7b5610a0da2c8f300c8f8725998a0014a807432ff94a5b8e8fb05e1"}},{"ruleId":"D1","level":"warning","message":{"text":"FleetTool.runFleet (cyclomatic 24): FleetTool.runFleet has cyclomatic complexity 24 (threshold 15). Of this number, 21 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":"internal/agent/fleet.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba89dbcad79907f96046fba9eece99024e414175a65d0746cf2826a01f862643"}},{"ruleId":"D1","level":"warning","message":{"text":"adapter.readOutboundFile (cyclomatic 24): adapter.readOutboundFile 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":"internal/bot/feishu/outbound_media.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"6519ad3ff5d0bc3e7a60b5db7a713f0c05aad801e7131420dba391bcb330799c"}},{"ruleId":"D1","level":"warning","message":{"text":"BotGateway.handleDesktopCommand (cyclomatic 24): BotGateway.handleDesktopCommand 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":"internal/bot/desktop.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"db566ec7d86aa785b6d6ac08a72d4c41ffb8bcbf78b87877b02a7bb390f74500"}},{"ruleId":"D1","level":"warning","message":{"text":"adapter.connectGateway (cyclomatic 24): adapter.connectGateway has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/qq/gateway.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"92562ef30ee595e5e12b7e4799a625545583403a5bb2bc4fd3314908dedc57f9"}},{"ruleId":"D1","level":"warning","message":{"text":"capability.MCPServerEntries (cyclomatic 24): capability.MCPServerEntries 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":"internal/capability/catalog.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"abc4a4511ac76d0e72408e86bed2b56d58ebdf2bcc16a4619f6e65dacad7f19b"}},{"ruleId":"D1","level":"warning","message":{"text":"capdiag.probeLiveMCP (cyclomatic 24): capdiag.probeLiveMCP 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":"internal/capdiag/live.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"62a26e64a1e1475c28803e5d09e6997606527adc64dde2ce5889a615bc836150"}},{"ruleId":"D1","level":"warning","message":{"text":"hook.parseSimpleHookCommandFields (cyclomatic 24): hook.parseSimpleHookCommandFields 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":"internal/hook/command_normalize.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"c325f05cd56e5240b84fc4ed772d477db2ca93109ed113f4775664aec33d62b1"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.reconcilePreparedRepairTransaction (cyclomatic 24): repair.reconcilePreparedRepairTransaction 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":"internal/repair/transaction.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bcdfc9a74c3e85cc37a5ad156007d432c49aad7e68e97c620da5ef16404a62a"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.markUpdateHealthyMatching (cyclomatic 24): repair.markUpdateHealthyMatching has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 10 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":"internal/repair/update.go"},"region":{"startLine":2054}}}],"partialFingerprints":{"codehealthFindingId/v1":"1dd3824982e7f86767529b682258325fe85c07bbba961e424d018084571cc9a4"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.ssrfGuardedTransport (cyclomatic 24): builtin.ssrfGuardedTransport 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 3 function literals inside it that branch (lines 105, 73, 172). 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":"internal/tool/builtin/webfetch.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f8abcd026a52ec18b309ca9b1c63ed1608366b1d74a6221b94c529800e02f70"}},{"ruleId":"D1","level":"warning","message":{"text":"main.previewEventSessionMessages (cyclomatic 23): main.previewEventSessionMessages 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":"desktop/app.go"},"region":{"startLine":6509}}}],"partialFingerprints":{"codehealthFindingId/v1":"b196f81a540041ab4b2b9c0acdb8f231d78423c3e1a0cd58a160882d8efec3cf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.publishThemeDir (cyclomatic 23): main.publishThemeDir has cyclomatic complexity 23 (threshold 15). 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: 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":"desktop/theme_store.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc800c9a922efe2456de4cb1efce1849906787a049fb6cb4cf19f4dccefe2a85"}},{"ruleId":"D1","level":"warning","message":{"text":"main.applyDebLinux (cyclomatic 23): main.applyDebLinux has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent 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":"desktop/updater_deb_linux.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8102badb6b93b11d9d095a2baa93751ac6478523f74adfb4c91099cab42235a"}},{"ruleId":"D1","level":"warning","message":{"text":"App.installPortableUpdate (cyclomatic 23): App.installPortableUpdate 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":"desktop/updater_app.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7d95f4f1a75457ee8674e10bd655af5a493dfd1789dc6168016fb79378ef00e"}},{"ruleId":"D1","level":"warning","message":{"text":"main.renderDiff (cyclomatic 23): main.renderDiff 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":"cmd/e2ebench/diff.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b3759fb31780ba908c24140636ae8a27333a9e8f53c51091426a5ab16bb714a"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.transformAndCopyJsonl (cyclomatic 23): agent.transformAndCopyJsonl has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent 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":"internal/agent/migrate.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"b55c636f5b04fd5f16f93e4be31bd12f481f817c7800081cd91ff788aa59f1b7"}},{"ruleId":"D1","level":"warning","message":{"text":"boundedllm.Call (cyclomatic 23): boundedllm.Call has cyclomatic complexity 23 (threshold 15). 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, separate the cases: extract each independent 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":"internal/boundedllm/bounded.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca2ff8c615cccfb2eaf58bb2c43448487bfca65b66c8f079eeeda078835a3def"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.CommitRewind (cyclomatic 23): Store.CommitRewind 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":"internal/checkpoint/transaction.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"21568cc94e6f1dcbd989054da11c9bbb04343f580cfb49a6656a806ae4847768"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.UndoRewind (cyclomatic 23): Store.UndoRewind 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":"internal/checkpoint/transaction.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"dac76d2534d7fbacab76b401f6e379f41cecb967644b4812a792a163c9ecb939"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.printPluginInventory (cyclomatic 23): cli.printPluginInventory 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":"internal/cli/plugin.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5607e7183d93fa9f8d778bd34d5a52f547cb80d5a335797308692b32610f6e1"}},{"ruleId":"D1","level":"warning","message":{"text":"mdRenderer.renderTable (cyclomatic 23): mdRenderer.renderTable 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":"internal/cli/md.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"52cf439c0c84233064b6ea8588adfb3a71cc85dc9ec5d292fca019b87620e722"}},{"ruleId":"D1","level":"warning","message":{"text":"config.loadForRoot (cyclomatic 23): config.loadForRoot 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":"internal/config/load.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f6100ae6d651d363e7829d69c431c657ab6657877c7572a47ee4e5e4a028966"}},{"ruleId":"D1","level":"warning","message":{"text":"turnOrchestrator.advanceGoalAfterTurn (cyclomatic 23): turnOrchestrator.advanceGoalAfterTurn 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":"internal/control/turn_orchestrator.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a7475f9f461137dfebb9563f752b5be9101b4e100d725b43004109afd4280db"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.ValidateSerialTodos (cyclomatic 23): evidence.ValidateSerialTodos 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":"internal/evidence/evidence.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa4a5d982b4c509d969e4acc20f2b6619a654d00449c74d48e87141b7513cbfc"}},{"ruleId":"D1","level":"warning","message":{"text":"Ledger.HasHostReviewCoverageAfter (cyclomatic 23): Ledger.HasHostReviewCoverageAfter 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":"internal/evidence/evidence.go"},"region":{"startLine":874}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ea3275556af41f069ee05b11920c3f42b1a83ffa8771b1564405f4b533e94c8"}},{"ruleId":"D1","level":"warning","message":{"text":"Dispatcher.Intercept (cyclomatic 23): Dispatcher.Intercept 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":"internal/extension/dispatch/dispatch.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"82be9ab738a7bc481fe167f5c63c18d25250b10e5b665c7380bdba466fbaa1d5"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.localSkillActions (cyclomatic 23): installSourceTool.localSkillActions 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":"internal/installsource/plan.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"18ddb4c1c7f91c1aa99477491c991500101bc80f4bddb5f0b649597a7089bc67"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.StartForSession (cyclomatic 23): Manager.StartForSession has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 469). 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":"internal/jobs/jobs.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"47a473d9d5506a05c9804b16284442f264092b84b2fda17e7ab735e965657d18"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.parseNativeV1 (cyclomatic 23): pluginpkg.parseNativeV1 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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"27720293636f80eb89830bf152ab28854076d7922546baee9dc6d4669784e6a0"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.validateV1Paths (cyclomatic 23): pluginpkg.validateV1Paths has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"80228ba33fc66dda8076b06fde9936abe1833182389a5101c5a93418b6340702"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.PrepareFileUpdate (cyclomatic 23): repair.PrepareFileUpdate 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":"internal/repair/update.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f1f22323af6047320eec224fdedb7ad880ace50c44a81a45b0ee0f8989992b6"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.cancelPendingUpdateMatching (cyclomatic 23): repair.cancelPendingUpdateMatching has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 8 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":"internal/repair/update.go"},"region":{"startLine":2191}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c724934e2a16e924c94164d86bc44992d83d3838c760e8ddabd73ca801e2b86"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.models (cyclomatic 23): Server.models 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":"internal/serve/serve.go"},"region":{"startLine":1227}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a709048bccdb9ebcb3a066846ebf08a10c09ffd91c407fb23c9ff9e03697496"}},{"ruleId":"D1","level":"warning","message":{"text":"Writer.Query (cyclomatic 23): Writer.Query 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":"internal/stats/query.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"03de0a0f7c7e73767128e3a9424796cacbfe9b568865bb3dd9a2c07d518b06dd"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.verifyStepEvidence (cyclomatic 23): builtin.verifyStepEvidence 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":"internal/tool/builtin/completestep.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"0083668099fdd898db593b9d8df9153a8a18ec3714038d9bc41b177c6f6d809e"}},{"ruleId":"D1","level":"warning","message":{"text":"codeIndex.collect (cyclomatic 23): codeIndex.collect has cyclomatic complexity 23 (threshold 15). Of this number, 12 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":"internal/tool/builtin/codeindex.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"62c8ec49990697f36f3772d2a8d84808a1bd9c134306b617784705aadc53fcf1"}},{"ruleId":"D1","level":"warning","message":{"text":"deleteRange.preview (cyclomatic 23): deleteRange.preview 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":"internal/tool/builtin/delete_range.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"e06d1920bf4e29310710cfc9b7cf3ab1bfbbcaa1740d2f351759bf7681b7ddd1"}},{"ruleId":"D1","level":"warning","message":{"text":"grepTool.runNative (cyclomatic 23): grepTool.runNative has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 168, 241). 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":"internal/tool/builtin/grep.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"221398799282559efd4b05fceadbae23ce5eff536bbbfb94572025d3be65388a"}},{"ruleId":"D1","level":"warning","message":{"text":"App.UpdateMCPServer (cyclomatic 22): App.UpdateMCPServer has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":8991}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c9e1188d599c83db26f64051a6cce5f08764e68de2958af9d973668be750fb2"}},{"ruleId":"D1","level":"warning","message":{"text":"App.CopyThemePack (cyclomatic 22): App.CopyThemePack 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":"desktop/theme_app.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fec31abc8356e794227ef5862666d8279220e4ee777d420dac4a000f3a34c81"}},{"ruleId":"D1","level":"warning","message":{"text":"App.WorkspaceChanges (cyclomatic 22): App.WorkspaceChanges has cyclomatic complexity 22 (threshold 15). Of this number, 19 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":"desktop/workspace_changes.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"c65e05be2a8498655eab17bebb2c86ac10e6e20a2f38b70c45263e97ae1f990d"}},{"ruleId":"D1","level":"warning","message":{"text":"main.run (cyclomatic 22): main.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/reasonix-legacy-migrator/main.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8938b855009d7bb69df9f44033dbb5f94e9aee0416fffa899a9283484d7738c"}},{"ruleId":"D1","level":"warning","message":{"text":"UseCapabilityTool.ResolveCall (cyclomatic 22): UseCapabilityTool.ResolveCall has cyclomatic complexity 22 (threshold 15). Of this number, 19 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":"internal/agent/usecapability.go"},"region":{"startLine":556}}}],"partialFingerprints":{"codehealthFindingId/v1":"8556f25158b99d431031fa412d585328a800d55dbb4c3c380d8f29911ffa57d3"}},{"ruleId":"D1","level":"warning","message":{"text":"BotGateway.handleMessage (cyclomatic 22): BotGateway.handleMessage 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":"internal/bot/gateway.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a24add75f3f84145fa83ecd96585f4f1d9a951843c72dc3e4d4f6adb5ba9a0"}},{"ruleId":"D1","level":"warning","message":{"text":"capdiag.RenderText (cyclomatic 22): capdiag.RenderText 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":"internal/capdiag/render.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"781f72f75d3401cfefeb9dc5b4a005d78da986112a0b50b7091f7d04a53e41b7"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.normalizeMath (cyclomatic 22): cli.normalizeMath has cyclomatic complexity 22 (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":"internal/cli/latex.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa1b838228e378e510c58fa338210244989bc3037f898fa88e1967ba435fbb1b"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.machineRecoveries (cyclomatic 22): cli.machineRecoveries has cyclomatic complexity 22 (threshold 15). Of this number, 21 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":"internal/cli/session_machine.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e192644a86e4ef551d07d0e43169701dc164153e9884fc219ff0d148c15ab67"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.handleChooserKey (cyclomatic 22): chatTUI.handleChooserKey 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":"internal/cli/chooser.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"f29bc95f516ffef3a560deaba5e831e44e64bfdf3db1446260d97ff1393acedf"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.runEffortCommand (cyclomatic 22): chatTUI.runEffortCommand 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, 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":"internal/cli/effort.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"246dca5e1e1fb6822c6a7688690e13311cc36c01f655f6857c781bbff7c5de06"}},{"ruleId":"D1","level":"warning","message":{"text":"config.replaceTOMLSection (cyclomatic 22): config.replaceTOMLSection 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":"internal/config/edit.go"},"region":{"startLine":1832}}}],"partialFingerprints":{"codehealthFindingId/v1":"7aa57a82ca0226586ee27ff4868613b4b7cb2a2f82e8e36b5fd97367dab30fab"}},{"ruleId":"D1","level":"warning","message":{"text":"config.MigrateLegacyIfNeededForRoot (cyclomatic 22): config.MigrateLegacyIfNeededForRoot has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/migrate.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"249afd0c4190f954fe3af82596e5b330a7e3c47eddb9dc23f75e2e0e29a667a3"}},{"ruleId":"D1","level":"warning","message":{"text":"doctor.WriteSessionBundle (cyclomatic 22): doctor.WriteSessionBundle 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":"internal/doctor/session_bundle.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"3303a2a501bf2f26358c06e756d8f3f63354f93059ecc040028ade285d054af9"}},{"ruleId":"D1","level":"warning","message":{"text":"rpcwire.validateStrictFrame (cyclomatic 22): rpcwire.validateStrictFrame 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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5c83f831a6e5439f4fdbbe7c8f00aa698cccdc011db492c6faf40535245474c"}},{"ruleId":"D1","level":"warning","message":{"text":"Conn.dispatch (cyclomatic 22): Conn.dispatch 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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"26ff7f094dfa18573f3f238fc9867cf196e8094b38b36c685010406ec88792ea"}},{"ruleId":"D1","level":"warning","message":{"text":"mcpregistry.normalize (cyclomatic 22): mcpregistry.normalize 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":"internal/mcpregistry/registry.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"eeec19e3cf959c0c7edd7401c9eea6b2f6d9fe2c64a260def3f3988ae3f53869"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.appendClaudeMCPFile (cyclomatic 22): pluginpkg.appendClaudeMCPFile 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":"internal/pluginpkg/claude_compat.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"8984d897c0ebe1cf0b885e5ac4893c60658c249c7688e894e19774831e40b006"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.gitPushTaskGrantBoundary (cyclomatic 22): recovery.gitPushTaskGrantBoundary 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":"internal/recovery/rules.go"},"region":{"startLine":712}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fa2eba66b64ea05ffdb9dd29ff29e67ace211562e6e96024fa74e387e711dfd"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.rebuildDerivedStateBoundUnlocked (cyclomatic 22): repair.rebuildDerivedStateBoundUnlocked 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":"internal/repair/derived.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"1324db5c608bf107d1bb922ea5fb5a30aeb5368aa0abcc3a838216efa6d04ddb"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateAppBundleHandoffMetadata (cyclomatic 22): repair.validateAppBundleHandoffMetadata has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/update.go"},"region":{"startLine":3269}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5b2d8974228e590628372135f56e08fdbc2287fdc6b0188bb59fd2a7e11dc07"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateSupersededPendingFileUpdate (cyclomatic 22): repair.validateSupersededPendingFileUpdate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/update_legacy.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e0060df2f66dbbb1d7856a4a0f74baa478d14517de8ff4611aa2de4ffda2f59"}},{"ruleId":"D1","level":"warning","message":{"text":"FileStore.AppendAuditEvent (cyclomatic 22): FileStore.AppendAuditEvent has cyclomatic complexity 22 (threshold 15). Of this number, 20 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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"15287713264e153a3eb0b0e8c823bca5d2efab8dc29aa9cb417666c9b738e9df"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.bracePairsByLine (cyclomatic 22): builtin.bracePairsByLine 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":"internal/tool/builtin/delete_range.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8a03c21c5b97bb33123d783ed84c1c4fa5148c08ae954c5d0841dcc54a540a4"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateSessionPath (cyclomatic 21): main.validateSessionPath 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":"desktop/sessions.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"e39ca711c779d839d70b9335d7b11f2d6e7fdeb8eefa44edda58dc0dbcc1f188"}},{"ruleId":"D1","level":"warning","message":{"text":"App.ensureBlankTab (cyclomatic 21): App.ensureBlankTab 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":"desktop/tabs.go"},"region":{"startLine":2564}}}],"partialFingerprints":{"codehealthFindingId/v1":"01f5e64650326609785717c44677b298e9fcd58e6049dbdcf111131feb38939e"}},{"ruleId":"D1","level":"warning","message":{"text":"App.tabSessionMetaSnapshotForCurrentSession (cyclomatic 21): App.tabSessionMetaSnapshotForCurrentSession 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":"desktop/tabs.go"},"region":{"startLine":8723}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a06e272d483ab05cf7655f915e08431d821b4970b7dc2b17ce7509d8e529323"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateContract (cyclomatic 21): main.validateContract 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":"cmd/signpath-contract/main.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ef9faca00f1bcba66bb55082a0fb232c8b43417a66e50453e31f0cb58931b9c"}},{"ruleId":"D1","level":"warning","message":{"text":"acp.availableCommandsFor (cyclomatic 21): acp.availableCommandsFor 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":"internal/acp/service.go"},"region":{"startLine":2454}}}],"partialFingerprints":{"codehealthFindingId/v1":"71c607051c3124ef73d902ab16563f32059033b525beceb44d2806b19d5ad113"}},{"ruleId":"D1","level":"warning","message":{"text":"updateSink.Emit (cyclomatic 21): updateSink.Emit 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":"internal/acp/dispatch.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"bac90f22cfb402706d48432be5e5f76d38213063744f6945f2469e96b087209c"}},{"ruleId":"D1","level":"warning","message":{"text":"boot.subagentEffectiveIdentity (cyclomatic 21): boot.subagentEffectiveIdentity 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":"internal/boot/boot.go"},"region":{"startLine":2527}}}],"partialFingerprints":{"codehealthFindingId/v1":"d752a98800995d5caef7b1d7a20a6fd7d90a73e1b8bed955d59c2a981afc18fd"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.reportCommandWithIO (cyclomatic 21): cli.reportCommandWithIO 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":"internal/cli/report.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef27786f1c29a534c37ecdaef258aec95a4af0eaef1f38b62a79f579e3dafc39"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.subagentEditCommand (cyclomatic 21): cli.subagentEditCommand 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":"internal/cli/subagent.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccc6f9130aadcc088138a9346f1cf8149930bdb116ae044478816cea74612e87"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.taskEventsCmd (cyclomatic 21): cli.taskEventsCmd 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":"internal/cli/task.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"745297c5fe9a022ccf203c4d35b16d9fb5280799e27fa4af6751a6da2c7e3d02"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.parseTaskMachineOptions (cyclomatic 21): cli.parseTaskMachineOptions 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":"internal/cli/task_machine.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"e357cb6031d2f1250d478e72aa7314ea339bae13f265e20f32702fc77f11f018"}},{"ruleId":"D1","level":"warning","message":{"text":"acpFactory.SessionConfigState (cyclomatic 21): acpFactory.SessionConfigState 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":"internal/cli/acp.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd798211142ef87db5917b0ec98d5abe78507a38f53c7443f7323cbeb56a3189"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.fileItems (cyclomatic 21): chatTUI.fileItems has cyclomatic complexity 21 (threshold 15). Of this number, 20 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":"internal/cli/complete.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"daf087f7448724afc4fb64e8dd8de0f780893bbaffe0b13d448a878192607837"}},{"ruleId":"D1","level":"warning","message":{"text":"config.planLegacyMCPDisable (cyclomatic 21): config.planLegacyMCPDisable 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":"internal/config/edit.go"},"region":{"startLine":1322}}}],"partialFingerprints":{"codehealthFindingId/v1":"b55f4143849df3c6d9fc6cb609b70b346e5d1fee88d931ecad15d0d7c0fb925b"}},{"ruleId":"D1","level":"warning","message":{"text":"config.RemovePluginFromSourcesForRoot (cyclomatic 21): config.RemovePluginFromSourcesForRoot has cyclomatic complexity 21 (threshold 15). Of this number, 19 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":"internal/config/edit.go"},"region":{"startLine":1416}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0d481a0803a09e455df509e8294404d8cb186f9a707d02f8dc7ada43f9e3862"}},{"ruleId":"D1","level":"warning","message":{"text":"config.EffortCapabilityForEntry (cyclomatic 21): config.EffortCapabilityForEntry has cyclomatic complexity 21 (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":"internal/config/effort.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4bfc169e39ea425ee4eec0263b905beb9471003b92cabdd84d97bc4cf699862"}},{"ruleId":"D1","level":"warning","message":{"text":"environment.FormatSection (cyclomatic 21): environment.FormatSection 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":"internal/environment/probe.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a6578e6c4845e4419e6b8afba30c0a24d52f3b2557c4cfc5d1912271cf5860a"}},{"ruleId":"D1","level":"warning","message":{"text":"eventwire.ToWire (cyclomatic 21): eventwire.ToWire 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":"internal/eventwire/wire.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8004e9291c33995d88acc4115bacbeacbacbe8aeaef17d63d16fdc28776bc60"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.AdvanceSerialTodo (cyclomatic 21): evidence.AdvanceSerialTodo 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":"internal/evidence/evidence.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"215b646c981550071c74b1bf708a36f3a48cf25a9731d1832d744ba2bc6344ef"}},{"ruleId":"D1","level":"warning","message":{"text":"protocol.buildJSONSchema (cyclomatic 21): protocol.buildJSONSchema 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":"internal/extension/protocol/schema.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"f94d58f0c4781afb12de5e915849fd4399876ca3f91b9aa1e4732e765989038d"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateRepairChange (cyclomatic 21): repair.validateRepairChange 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":"internal/repair/transaction.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3e2b156bf9f76014fb05f8a61a7fe71727a6b56e6e6c90a0f3e56563efe2ca2"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.claimPendingAppBundleUpdateHandoff (cyclomatic 21): repair.claimPendingAppBundleUpdateHandoff 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":"internal/repair/update.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"e37baff15d8e17c076b725c6e164ead65b9064fe5df1682392b8c115539d161b"}},{"ruleId":"D1","level":"warning","message":{"text":"Client.flushPending (cyclomatic 21): Client.flushPending has cyclomatic complexity 21 (threshold 15). Of this number, 18 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":"internal/telemetry/client.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"f73cd12b3ff3f2c6a2d6310157e3ab4af969fe0963f3defd8a123f6ebd23d608"}},{"ruleId":"D1","level":"warning","message":{"text":"globTool.globRecursive (cyclomatic 21): globTool.globRecursive has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 9 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":"internal/tool/builtin/glob.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f708e7a91b2c2c998c47a5ae793336a26670f2a8efcaff3ae8e36164df78615"}},{"ruleId":"D1","level":"warning","message":{"text":"conn.dispatch (cyclomatic 21): conn.dispatch 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":"sdk/go/wire.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8e1ddaa0ddb69b94477608ee63cf8120c2332b6afdab3ae83c5444b96206216"}},{"ruleId":"D1","level":"warning","message":{"text":"main.historyToolSummary (cyclomatic 20): main.historyToolSummary 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":"desktop/app.go"},"region":{"startLine":6233}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9f40fdfc1348b076672c4e0e5ad599d2acc2be896702420409e3315458cc418"}},{"ruleId":"D1","level":"warning","message":{"text":"main.writeThemeStaging (cyclomatic 20): main.writeThemeStaging has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 7 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":"desktop/theme_store.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede491793cb6e755f8f1013bf7f09fb2e4032ace1757b1dbe0adba6c7ca29f24"}},{"ruleId":"D1","level":"warning","message":{"text":"App.handleTabSessionRecovered (cyclomatic 20): App.handleTabSessionRecovered has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 6062). 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":"desktop/tabs.go"},"region":{"startLine":6061}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c57a9f07ba60fcf544420f64bf921d2b47e754c4cac64afd90bb70dd54a273e"}},{"ruleId":"D1","level":"warning","message":{"text":"main.genManifest (cyclomatic 20): main.genManifest 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":"desktop/cmd/sign/main.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"316e097d826cc0d2f0eb4867888066a6f8c86c9d511ea75a6f9de13f21311e46"}},{"ruleId":"D1","level":"warning","message":{"text":"RemoteHostStore.loadLocked (cyclomatic 20): RemoteHostStore.loadLocked 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":"desktop/remote_hosts.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"456dc3e9370f1daef7b49351381fa3f495e2627239a6e126610bf56bfb3088c9"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.rehomeStrandedSessions (cyclomatic 20): agent.rehomeStrandedSessions 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":"internal/agent/migrate.go"},"region":{"startLine":747}}}],"partialFingerprints":{"codehealthFindingId/v1":"e501265d5408b234627527403745f651e6cd6ddce841763e07e85865b3107a30"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.applyDeliveryPolicyGates (cyclomatic 20): Agent.applyDeliveryPolicyGates 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":"internal/agent/execute_one.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"54293384b96b9f3c8d371463adfc41340742543e77842efb12c440a9d3c819b5"}},{"ruleId":"D1","level":"warning","message":{"text":"UseCapabilityTool.inspect (cyclomatic 20): UseCapabilityTool.inspect 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":"internal/agent/usecapability.go"},"region":{"startLine":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ebb49c187b17be303d65794eb0b78566273f930c6d938cb867d4908538bd244"}},{"ruleId":"D1","level":"warning","message":{"text":"weixin.PollLogin (cyclomatic 20): weixin.PollLogin 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":"internal/bot/weixin/weixin_login.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9fa9b40e326f14d9097faa789cacf9c7c62570da0c145fa89492ca3f98ed4fd"}},{"ruleId":"D1","level":"warning","message":{"text":"capability.RenderTransientBlock (cyclomatic 20): capability.RenderTransientBlock 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":"internal/capability/capability.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc751583b10ee67b82232d1f399259512375de0f323f6449ef8f6b53203c6917"}},{"ruleId":"D1","level":"warning","message":{"text":"capability.semanticPool (cyclomatic 20): capability.semanticPool 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":"internal/capability/semantic.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"a13055f649ec4a5fd2e96b6c31e8808417319c8be67e896180683d3e2a1c3c32"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.CommitRewindWithForward (cyclomatic 20): Store.CommitRewindWithForward 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":"internal/checkpoint/transaction.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"cee9bf70dfa6c76f08e0ffef9a89c621c015d9153c1bd2a51aa3c42c9f4f7b14"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.configCompactRatioCommand (cyclomatic 20): cli.configCompactRatioCommand 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":"internal/cli/cli.go"},"region":{"startLine":2601}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc8b3e750a5173cb6ffc34f44d1843d94553a0e7ee9a92dcfe999bf06eb12450"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.defaultMCPNameFromArgv (cyclomatic 20): cli.defaultMCPNameFromArgv 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":"internal/cli/mcp.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"738a3535062536066c0e2751f5f5a2285557dc3fa32d89183529c10e33cd5891"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.pluginDoctorCommand (cyclomatic 20): cli.pluginDoctorCommand 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":"internal/cli/plugin.go"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"32f792b98bd2edb5c83679b10c0ef870f94f752ad785f4b313127ec5e04fcf7e"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.parseCopyTranscript (cyclomatic 20): cli.parseCopyTranscript 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":"internal/cli/transcript.go"},"region":{"startLine":534}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf6479cfd6af0234cc5f81e4b282fe3a7b4bd8513f16582925ff8e0b8d3cd1b1"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.handleSkillPickerKey (cyclomatic 20): chatTUI.handleSkillPickerKey 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":"internal/cli/skill_picker.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca433c23f670aff903a60a4744dfbdb5eac310888f6cd9cf26e83814ca99b2fa"}},{"ruleId":"D1","level":"warning","message":{"text":"quickPicker.handleKey (cyclomatic 20): quickPicker.handleKey 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":"internal/cli/quick_picker.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"efc2b00868ce8729ecd42af22654cc95774fd174e6e03de3b2cd57b7208bb3db"}},{"ruleId":"D1","level":"warning","message":{"text":"control.SaveAttachmentFile (cyclomatic 20): control.SaveAttachmentFile 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":"internal/control/attachments.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c89752fa7b2bdd6c4007794a444c8171f4f358de883fa5be1cc51e8b6df76fd"}},{"ruleId":"D1","level":"warning","message":{"text":"control.readFileRefUnscoped (cyclomatic 20): control.readFileRefUnscoped has cyclomatic complexity 20 (threshold 15). Of this number, 13 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":"internal/control/refs.go"},"region":{"startLine":1039}}}],"partialFingerprints":{"codehealthFindingId/v1":"be2530f8569a94901180b4bcdf72667f9b31a3e336917260648fa59da99b0a3c"}},{"ruleId":"D1","level":"warning","message":{"text":"installsource.copyDir (cyclomatic 20): installsource.copyDir has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 326). 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":"internal/installsource/skill.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"69a254e8520b982b91d4d3168adc5523d33f00b18c408a5d81e1c00171c0bd6e"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.Execute (cyclomatic 20): installSourceTool.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":"internal/installsource/install_source.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"eca49f4095ed3b55fff5a3638039df9f24f921861ec8a330bf05ca16728ac462"}},{"ruleId":"D1","level":"warning","message":{"text":"migration.migrateLegacySessionSources (cyclomatic 20): migration.migrateLegacySessionSources has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 6 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":"internal/migration/migration.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae8f03312a9567d76354cf014682bda0c89b5809027a3f52d3a7448ed79ff753"}},{"ruleId":"D1","level":"warning","message":{"text":"permission.isIndirectExecution (cyclomatic 20): permission.isIndirectExecution has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \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":"internal/permission/bash_approval.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"575a71fee33178d0171feb08378b0a135b64020a21b38586e599c9be90fa8880"}},{"ruleId":"D1","level":"warning","message":{"text":"plugin.Start (cyclomatic 20): plugin.Start has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 9 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":"internal/plugin/plugin.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"80735d037f5926956e1bece8b72330ec505708aca0db58d549899782e4c03a88"}},{"ruleId":"D1","level":"warning","message":{"text":"pluginpkg.parseV1Runtime (cyclomatic 20): pluginpkg.parseV1Runtime 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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"8200d4839b67826fc813608030677cbb84e63b9d59e326fdcd3e9439105f0f6a"}},{"ruleId":"D1","level":"warning","message":{"text":"productdocs.loadCatalogWithReleaseNotes (cyclomatic 20): productdocs.loadCatalogWithReleaseNotes 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":"internal/productdocs/docs.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"42967e5f5a9a070d32bb8ae80fa612d656f210419cdb84f996baed991c05f00b"}},{"ruleId":"D1","level":"warning","message":{"text":"responses.messagesToInput (cyclomatic 20): responses.messagesToInput 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":"internal/provider/responses/responses.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e21fe3ac22b8678bd03d08bfc2b0633119fd5f253bdcac5c5a5b0534ff1de28"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.Decide (cyclomatic 20): recovery.Decide 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":"internal/recovery/decision.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c6f1db210a6195a1e43c20560bce8c7d3dc4c1160e1e85d315c22f72360bdb4"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.ghAPICommandHighRisk (cyclomatic 20): recovery.ghAPICommandHighRisk 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":"internal/recovery/rules.go"},"region":{"startLine":565}}}],"partialFingerprints":{"codehealthFindingId/v1":"15e3261e5a54ea8813f0d35533e900d1cd7ef725e6460aee1ee6639d1a0e6e2b"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.askHuman (cyclomatic 20): Gate.askHuman 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":"internal/recovery/gate.go"},"region":{"startLine":1011}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b1d42c7d7d8be6c4438a1dd53388393b7c9d38c720ccc280bec3f6934b7d7c9"}},{"ruleId":"D1","level":"warning","message":{"text":"remote.discoverSSHAliases (cyclomatic 20): remote.discoverSSHAliases 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":"internal/remote/sshconfig.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d06811834b15703f361e15c3d5c6b8852a69c239efe5b92d5def370bedf5ab0"}},{"ruleId":"D1","level":"warning","message":{"text":"bootstrap.EnsureServe (cyclomatic 20): bootstrap.EnsureServe 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":"internal/remote/bootstrap/bootstrap.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"de62708fb960064a3df15083b668380756db3b38de0d3c1ac315a5e63d771c4e"}},{"ruleId":"D1","level":"warning","message":{"text":"FileStore.SaveTask (cyclomatic 20): FileStore.SaveTask has cyclomatic complexity 20 (threshold 15). 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: 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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"20691ca887da925ea417b5f3673f6c65710e066423afddb03a161cbc03fca630"}},{"ruleId":"D1","level":"warning","message":{"text":"moveFile.Execute (cyclomatic 20): moveFile.Execute 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":"internal/tool/builtin/movefile.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"46136d6f49ee5ef852bb466b327ef6c5d6031951960e1b0c4fddacd409075299"}},{"ruleId":"D1","level":"warning","message":{"text":"extension.validateStrictFrame (cyclomatic 20): extension.validateStrictFrame 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":"sdk/go/wire.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"d06a628160679494822bd07bcf166309d606ded40299ba01ffd4ac4ed33ac5bf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.canonicalRemoteSSHHost (cyclomatic 19): main.canonicalRemoteSSHHost 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":"desktop/remote_hosts.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"acf18b0df0814593aa7f040d5ddbecdcf4a43ed55128f15c7f2e55ab6717a6d3"}},{"ruleId":"D1","level":"warning","message":{"text":"main.reconcileDesktopTrashSessionArtifacts (cyclomatic 19): main.reconcileDesktopTrashSessionArtifacts 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":"desktop/sessions.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc2cb2fa3d567348028a9a9479eb8faa078c199daece2807fb450425f36de6e7"}},{"ruleId":"D1","level":"warning","message":{"text":"App.InstallMCPServer (cyclomatic 19): App.InstallMCPServer 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":"desktop/app.go"},"region":{"startLine":8891}}}],"partialFingerprints":{"codehealthFindingId/v1":"3231317ed566ea3c96eec173e85a1e678f1e0730332daa11d9314b02d9a7569c"}},{"ruleId":"D1","level":"warning","message":{"text":"App.openTopicTabWithActivation (cyclomatic 19): App.openTopicTabWithActivation 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":"desktop/tabs.go"},"region":{"startLine":2360}}}],"partialFingerprints":{"codehealthFindingId/v1":"6033287f20590a34adef6e96b0e4c768ae9985f3241f09b2377009b132a4b1b3"}},{"ruleId":"D1","level":"warning","message":{"text":"updateSink.permissionMeta (cyclomatic 19): updateSink.permissionMeta 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":"internal/acp/dispatch.go"},"region":{"startLine":416}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5a83dda6e0e04c9ca0fb70face5e1febbc220c06e14b4830e5ea52fec98ea53"}},{"ruleId":"D1","level":"warning","message":{"text":"service.reloadSessionExtensionsLocked (cyclomatic 19): service.reloadSessionExtensionsLocked has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/acp/service.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"be64837407220fd8a59bde7298e24c932e3f8a1e07d7eb6ac40d079a5fcdef67"}},{"ruleId":"D1","level":"warning","message":{"text":"service.applyPendingSessionConfig (cyclomatic 19): service.applyPendingSessionConfig 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":"internal/acp/service.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eed55bdf7cf1e800d05ed5cd06108fa085e9a03698b395b9acb4adfc16b4bee"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.deliveryTaskHasFileReference (cyclomatic 19): agent.deliveryTaskHasFileReference 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":"internal/agent/agent.go"},"region":{"startLine":2135}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbacd2d2b4b688e0e5e744ef162e9d137e23a3138ce4211058b26be58dc4a6d3"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.deliveryTaskAdvisoryClauseRequestsMutation (cyclomatic 19): agent.deliveryTaskAdvisoryClauseRequestsMutation 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":"internal/agent/agent.go"},"region":{"startLine":2289}}}],"partialFingerprints":{"codehealthFindingId/v1":"13ac57972562551ba4ae93024384bb0d8b1000f26efec502082150d2af17be2a"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.interruptedRecoveryBlock (cyclomatic 19): agent.interruptedRecoveryBlock 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":"internal/agent/interrupted_recovery.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1637e3d6e51bf51b2abf182d2e7c15fb89cd34f3e95c224b2fe2b8e22ee6cf4"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.renameOverlongSession (cyclomatic 19): agent.renameOverlongSession 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":"internal/agent/save.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"ceb7c76a42fb921f48ace620a5666b2c1e2d4fbda2c0aa27e6357f0d5ea79e56"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.capabilityGateFailure (cyclomatic 19): Agent.capabilityGateFailure 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":"internal/agent/capability_gate.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2466a7e2e2a09b6ffbddc8dac62dcbe2ab1b54afca256a734612315ec0e165f"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.maybeCompact (cyclomatic 19): Agent.maybeCompact has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/compact.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"bed9f117936babcdc886c8ed5a788a95188bb73669751a625434ba6b7f6a43cc"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.maintainStaleToolResults (cyclomatic 19): Agent.maintainStaleToolResults 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":"internal/agent/prune.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"22cf777dca0fe7b99d9f7779af54679ca5fcfa23793e74ea05c583f820f544c4"}},{"ruleId":"D1","level":"warning","message":{"text":"SubagentResultTool.Execute (cyclomatic 19): SubagentResultTool.Execute has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/subagent_result.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c1005aac359c1e6ebbea343a18b2d41dbf2c50fa063169e85e4d0326f44fef4"}},{"ruleId":"D1","level":"warning","message":{"text":"adapter.handleSDKMessage (cyclomatic 19): adapter.handleSDKMessage has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/feishu/feishu.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c13b8c646565865559249fe6f87880043097187d28fc69edd5b7b4e808aa804"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.resolveSessionQuery (cyclomatic 19): cli.resolveSessionQuery 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":"internal/cli/cli_flags.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"37ed1c958ab6239597d3477d54a35ad97929fe352cbcdacc715d8fb509990eff"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.remoteConnectCLI (cyclomatic 19): cli.remoteConnectCLI has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 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":"internal/cli/remote_connect.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"0aea15a986a2552d3a7b1dbf05f0b07ade7946d661591c2354d1bc42109222ed"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.parseSessionMachineOptions (cyclomatic 19): cli.parseSessionMachineOptions 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":"internal/cli/session_machine.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb4037f649d05f32b1c9a1b3a95767de653daff9d1a4d7eba034fcc890609542"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.runMCPSubcommand (cyclomatic 19): chatTUI.runMCPSubcommand 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":"internal/cli/chat_tui.go"},"region":{"startLine":5097}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc3bdc4a2cc9c197728cadf91c5d2acd5947525758f48baa46bed17f20f7b3c0"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.acceptCompletion (cyclomatic 19): chatTUI.acceptCompletion has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/complete.go"},"region":{"startLine":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ec68e8e5595b8e2b8a0a52e835bfda058fcbc45d62a26d0294891a7d5ae8fbb"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.bashReadOnlyCommandWrites (cyclomatic 19): evidence.bashReadOnlyCommandWrites has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/evidence.go"},"region":{"startLine":2176}}}],"partialFingerprints":{"codehealthFindingId/v1":"645f19df2f3e585d1d6dc97fda86eaab97c11cb673853be49d5d007db794b72f"}},{"ruleId":"D1","level":"warning","message":{"text":"Searcher.Search (cyclomatic 19): Searcher.Search 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, separate the cases: extract each independent 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":"internal/history/search.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"93b7fa2964d92551c695defff9e0f5171854f6828fb22e2c5ca72666a372861e"}},{"ruleId":"D1","level":"warning","message":{"text":"installlayout.RetainPreviousVersions (cyclomatic 19): installlayout.RetainPreviousVersions 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":"internal/installlayout/activate.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7100a7e02869d2bf8df4395ac817ed48264ed83cceab4c7f27a97e4d32f9d94"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.planURL (cyclomatic 19): installSourceTool.planURL 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":"internal/installsource/plan.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7cbfa2dccc4e4e1bfa11f14bd989810b2e0ea1fdddcfff51366d75f2c531707"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.applyInstallPluginPackage (cyclomatic 19): installSourceTool.applyInstallPluginPackage 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":"internal/installsource/plugin_package.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"148407f8baaf4ba877d462f7e964bc943e8cdf562210756c8a4d1afa35fbb4a2"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.loadSessionArtifacts (cyclomatic 19): Manager.loadSessionArtifacts 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":"internal/jobs/jobs.go"},"region":{"startLine":1535}}}],"partialFingerprints":{"codehealthFindingId/v1":"32d8c7e21856afa47a9313620fda5821e1adcd4588cc92c5908a6c327b7a52ec"}},{"ruleId":"D1","level":"warning","message":{"text":"httpTransport.readSSEResponse (cyclomatic 19): httpTransport.readSSEResponse has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 9 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":"internal/plugin/transport_http.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae75d747818ccaafe38eb05ff22d3eda6c9e55b32bc1cfc76b0d237b9287ae72"}},{"ruleId":"D1","level":"warning","message":{"text":"provider.attachStandaloneDecisionReceipts (cyclomatic 19): provider.attachStandaloneDecisionReceipts has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/provider/provider.go"},"region":{"startLine":310}}}],"partialFingerprints":{"codehealthFindingId/v1":"de90a86e889e03095f14475be9a37d3a4a605b7a2853d40941b28dbb4e775938"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.buildReviewEvidence (cyclomatic 19): recovery.buildReviewEvidence 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":"internal/recovery/reviewer.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"05210c083fca60bd345d2c87a4d2c75bd60bce58d770f7ab3ef50c84e31c6ac2"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.applyRepairPlanAction (cyclomatic 19): repair.applyRepairPlanAction 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":"internal/repair/plan.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"32ea57bc164fbf9da69580a25c1c407701b3ae99aa779ee41e24aafb24518b42"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.claimPendingFileUpdate (cyclomatic 19): repair.claimPendingFileUpdate has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/update.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f9e1377cf6e8248b9bf91d18a5e4d2be9a8ec8f2aa7da08967bc7dc45c31373"}},{"ruleId":"D1","level":"warning","message":{"text":"shellparse.ParseStaticCommand (cyclomatic 19): shellparse.ParseStaticCommand has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/shellparse/bash.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"0db43f6c15c77f2acfefcb3c2a25f417143676fcec683f99545f650cd932b361"}},{"ruleId":"D1","level":"warning","message":{"text":"sink.observe (cyclomatic 19): sink.observe 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":"internal/telemetry/sink.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"83114b192620edabab4b8d777c3c02a8cd6e74840cf00c7cfde7fce7f4371725"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.collectSymbols (cyclomatic 19): builtin.collectSymbols 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":"internal/tool/builtin/delete_symbol.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e5ce17960bc1d62aae3fa0b84fd1a6aaa7eca732f86e6a948299afdf39e8f4e"}},{"ruleId":"D1","level":"warning","message":{"text":"completeStep.Execute (cyclomatic 19): completeStep.Execute has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/completestep.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"801f78d27ff7dae821b35b05762a91cf995683acecf1d95f739942add3d0987b"}},{"ruleId":"D1","level":"warning","message":{"text":"main.saveExclusiveExportPayloads (cyclomatic 18): main.saveExclusiveExportPayloads has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent 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":"desktop/app.go"},"region":{"startLine":11210}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e42dbfc44d81b886b4632ee6d5eec3ac736c52d6bdc133ea9c5539de8e6426b"}},{"ruleId":"D1","level":"warning","message":{"text":"main.parseLinuxDesktopEntry (cyclomatic 18): main.parseLinuxDesktopEntry has cyclomatic complexity 18 (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":"desktop/external_opener_linux.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8014425c45ba1ce83ddce34da1d59b7f39099f3a04666781a4af2cad3f00e2"}},{"ruleId":"D1","level":"warning","message":{"text":"main.resolveLinuxDesktopIcon (cyclomatic 18): main.resolveLinuxDesktopIcon has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/external_opener_linux.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7117f3956fc8426c4a1579bd942251fd3f6d23e98162128ac2f018d8c52cb6c"}},{"ruleId":"D1","level":"warning","message":{"text":"main.restoreSessionTopicIndex (cyclomatic 18): main.restoreSessionTopicIndex has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":6905}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d0921d956b5dc19792f81dc4dbdb3c83aff3a2e70acdd255cf51b3034c60e30"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateThemeImageFile (cyclomatic 18): main.validateThemeImageFile has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_image.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfe6b78f1c3abe003b8cb73a0659d51901dad7d975dd1e73947ed8fadbd6752b"}},{"ruleId":"D1","level":"warning","message":{"text":"main.downloadInto (cyclomatic 18): main.downloadInto 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":"desktop/updater.go"},"region":{"startLine":914}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ee578ea6979667d41b851270e25466f7fc50924d0bf5ac5d31049f924e4caa1"}},{"ruleId":"D1","level":"warning","message":{"text":"App.keepOnlyVisibleTab (cyclomatic 18): App.keepOnlyVisibleTab has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 3170). 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":"desktop/tabs.go"},"region":{"startLine":3159}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fc9aeba6d32691c7ac0fae2e14c20347a553525ad682f69e08807ffd7c2b0f2"}},{"ruleId":"D1","level":"warning","message":{"text":"App.themeAssetMiddleware (cyclomatic 18): App.themeAssetMiddleware has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 22). 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":"desktop/theme_assets.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"f21eac8dfbeea4e5c5e8ce41b0693a7a9620f7ee4bc6a5ec28351c0efb436ab4"}},{"ruleId":"D1","level":"warning","message":{"text":"clientIO.RunCommand (cyclomatic 18): clientIO.RunCommand has cyclomatic complexity 18 (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":"internal/acp/clientio.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"be97d9a2159d96e67eae0b4a68554e74fa17b54840472b622a16ab21cded1409"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.extractPlannerDecisionOptions (cyclomatic 18): agent.extractPlannerDecisionOptions 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":"internal/agent/coordinator.go"},"region":{"startLine":710}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4646177bfbb41ab62ea9f2a79b7de4b0d69515705b22b396ad8b1bab2d0a83d"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.importJsonlSessions (cyclomatic 18): agent.importJsonlSessions 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":"internal/agent/migrate.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"aed50bf8dbcd2ed8af24cbe3dd68b392e49bac80c656f96fe7e84a64e08cd2a6"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.reconcileRecoveryTrashStage (cyclomatic 18): agent.reconcileRecoveryTrashStage 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":"internal/agent/recovery_gc.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"74e9e303124870d2a97cfe7cc29f652c4aaadc31459322d305170e4a6d6641ce"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.replaySessionEventLogWithLimits (cyclomatic 18): agent.replaySessionEventLogWithLimits 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":"internal/agent/session_events.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d2fa2a20af1acb26f32a0d2fc92ecca4070ef0cbb1e192c0d61ccc0fa9163e3"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.applyStormBreaker (cyclomatic 18): Agent.applyStormBreaker 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":"internal/agent/agent.go"},"region":{"startLine":3653}}}],"partialFingerprints":{"codehealthFindingId/v1":"a19cefbf95c49217922bbf180a6c8311a25c32cfe24d0efd8dde82eb9b7e4acd"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.compact (cyclomatic 18): Agent.compact 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":"internal/agent/compact.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"bce47faded64fc1a5512dbf7655a78984b1bf28c1a797c9dbec3796b82455bcb"}},{"ruleId":"D1","level":"warning","message":{"text":"UseCapabilityTool.Execute (cyclomatic 18): UseCapabilityTool.Execute 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":"internal/agent/usecapability.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d568c0235ed75f8cf3556ed27399550870f84a07425f661133291df1d1a0725"}},{"ruleId":"D1","level":"warning","message":{"text":"bot.mergeBotSessionEntry (cyclomatic 18): bot.mergeBotSessionEntry has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/project_index.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ea14873cc06517a10dedbf94d75d55789b36919f19a01fbd19cc5a6fecb156d"}},{"ruleId":"D1","level":"warning","message":{"text":"bot.searchBotProjectsFallback (cyclomatic 18): bot.searchBotProjectsFallback has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 682). 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":"internal/bot/project_index.go"},"region":{"startLine":675}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ab02dec677a8c9a6a3fd604ea155db2d68f6cab67262cc98bfd0df00b5140d1"}},{"ruleId":"D1","level":"warning","message":{"text":"botruntime.AdapterBindings (cyclomatic 18): botruntime.AdapterBindings 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":"internal/botruntime/runtime.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c1ee51448eeb4304efc44e31c9e512789528463f02ac17ab760813716f13b89"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.commitUndoTransaction (cyclomatic 18): Store.commitUndoTransaction 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":"internal/checkpoint/transaction.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"7da024415e6321128df5db6ffd89c95a41e8c6d9a6ce4915305cab17c3826c14"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.mcpBrowseWithClient (cyclomatic 18): cli.mcpBrowseWithClient 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":"internal/cli/mcp.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"19eefd82aed660921fc51d5c5ba88b4502d45e54309256c77acac867fea9bc16"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.mcpInstallWithClient (cyclomatic 18): cli.mcpInstallWithClient has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/mcp.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"724525f50f8fe53ca7476fd5049ec9689c8c09bb22111a802f4f9959dff33b7f"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.fixCJKEmphasis (cyclomatic 18): cli.fixCJKEmphasis 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":"internal/cli/md.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e0850eadfb532aad717f784a80276c8d437b219b85e7c6a9b2075b11625594a"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.editBuiltinSubagentProfile (cyclomatic 18): cli.editBuiltinSubagentProfile 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":"internal/cli/subagent.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b786498d31be679f5e1f9a6b719b95e8673718fb4a299e13d54572a51e351e6"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.runLanguageSubcommand (cyclomatic 18): chatTUI.runLanguageSubcommand has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 7 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":"internal/cli/language.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"036ad4aeb59d3dda7e7acf66d237c302b5f89cf187c8e1e28c89e83c3fbd9a83"}},{"ruleId":"D1","level":"warning","message":{"text":"config.migrateLegacyCredentialsIfNeededForRoot (cyclomatic 18): config.migrateLegacyCredentialsIfNeededForRoot has cyclomatic complexity 18 (threshold 15). 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, separate the cases: extract each independent 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":"internal/config/migrate.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"69b0ea6bcb5f87114321bf8c7904af858c9fd8e4193495fbafd8d547f1d011e6"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.resolveNewSessionChatModel (cyclomatic 18): Config.resolveNewSessionChatModel 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":"internal/config/config.go"},"region":{"startLine":1997}}}],"partialFingerprints":{"codehealthFindingId/v1":"44998a55246c80cba2d169d3e55e6c2098f1e72a7e4290ef6ccb6757434a171c"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.saveProjectIncrementalResolved (cyclomatic 18): Config.saveProjectIncrementalResolved has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/edit.go"},"region":{"startLine":1588}}}],"partialFingerprints":{"codehealthFindingId/v1":"41534d7db706ab230d7d97b7a705a203279e4c063ac29a810bc1ca159435aee0"}},{"ruleId":"D1","level":"warning","message":{"text":"control.resolveInterruptedTurnStart (cyclomatic 18): control.resolveInterruptedTurnStart has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 6 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":"internal/control/controller.go"},"region":{"startLine":4661}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f77e96766100c57f21d8185998c0afbd330a98d9b3e1c641e47203c1c5a3966"}},{"ruleId":"D1","level":"warning","message":{"text":"control.listItem (cyclomatic 18): control.listItem has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/controller.go"},"region":{"startLine":6448}}}],"partialFingerprints":{"codehealthFindingId/v1":"11d5bc10bcf84089b88a7322aca529671cef64f01ea19f44768c584e44d7edb6"}},{"ruleId":"D1","level":"warning","message":{"text":"goalMachine.restoreFromState (cyclomatic 18): goalMachine.restoreFromState has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/goal.go"},"region":{"startLine":771}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3d5841f2bff21733352b1b87cb05b6fc0f4408c8954b31451648d0b1544eae1"}},{"ruleId":"D1","level":"warning","message":{"text":"doctor.Collect (cyclomatic 18): doctor.Collect 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":"internal/doctor/report.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"94f1d2ee46b5874157b6c64ce7c7d97e69e3fd32ced0552dffe599ec57ef180a"}},{"ruleId":"D1","level":"warning","message":{"text":"history.extractDocuments (cyclomatic 18): history.extractDocuments 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":"internal/history/search.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"ace9995034e7b474dda2e1d9dba61b8f203bc4252bbfb9f50ff47cead9e435da"}},{"ruleId":"D1","level":"warning","message":{"text":"memory.AutoRecall (cyclomatic 18): memory.AutoRecall 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":"internal/memory/auto_recall.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8a6797e68266e60c618abc1539143e03911a0053c52b57a1a88f59e2ed9b26a"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.archiveLocked (cyclomatic 18): Store.archiveLocked 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":"internal/memory/store.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6962db63b3ecd86a4b68aa6a3e06d793bb1a46fcea2ce98b824090c0f9112b3"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.MigrateV2 (cyclomatic 18): Store.MigrateV2 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":"internal/memory/store_v2.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"26b66835f317a9fa74994c3a7988c5c8b37e86aa010e19a3ed90f179f3453856"}},{"ruleId":"D1","level":"warning","message":{"text":"permission.hasAnyFoldedArg (cyclomatic 18): permission.hasAnyFoldedArg 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":"internal/permission/bash_approval.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddb0ac5d088a098aa8e6373f41680d0e7de8623adfd411d20daa8c4bb4bc830a"}},{"ruleId":"D1","level":"warning","message":{"text":"permission.rawBashPrefixMatches (cyclomatic 18): permission.rawBashPrefixMatches 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":"internal/permission/permission.go"},"region":{"startLine":447}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c97089649011963674dec61bd57acf2b3175dd963b9f557a228eb182c025150"}},{"ruleId":"D1","level":"warning","message":{"text":"productdocs.parseDocumentWithParser (cyclomatic 18): productdocs.parseDocumentWithParser has cyclomatic complexity 18 (threshold 15). Of this number, 10 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":"internal/productdocs/docs.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e8d11157ac8096351d6132f633b541987846b7a40e855a39986ecd632c14a58"}},{"ruleId":"D1","level":"warning","message":{"text":"recovery.ghTaskGrantBoundary (cyclomatic 18): recovery.ghTaskGrantBoundary has cyclomatic complexity 18 (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":"internal/recovery/rules.go"},"region":{"startLine":777}}}],"partialFingerprints":{"codehealthFindingId/v1":"81dd3d320146c71b2d2eb636652f1b0a001483b78b0ffd415a655d37aa9ed53f"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.ObserveResult (cyclomatic 18): Gate.ObserveResult has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/recovery/gate.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"306c18845222b4c21cb8e21602820a48cd3301dc10b0f7a2e4c91653e219a268"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.BeforeMutation (cyclomatic 18): Gate.BeforeMutation 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":"internal/recovery/gate.go"},"region":{"startLine":642}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf380b7126b47bf1ab4d7993a669138dacd9677ed3b52dc05195946e8dc27bb4"}},{"ruleId":"D1","level":"warning","message":{"text":"remote.parseOpenSSHEffectiveConfig (cyclomatic 18): remote.parseOpenSSHEffectiveConfig 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":"internal/remote/sshconfig.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aa663a311039291cd77079c64bbceb5a5fbe39456c758f3fcfb76f5a44d286a"}},{"ruleId":"D1","level":"warning","message":{"text":"bootstrap.acquireServeLock (cyclomatic 18): bootstrap.acquireServeLock 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":"internal/remote/bootstrap/lock.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"145722be4ad8386438567636d163df19cf73b7289ba9f7374c14461f4771f48e"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.RecoverFailedInstall (cyclomatic 18): repair.RecoverFailedInstall has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/apply_failure.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"913c361785c971f9f9b2e62f2bbdf8a6cb70bb4ac40e6dda8fa5d3fcd14a0072"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.cancelPendingAppBundleUpdateHandoff (cyclomatic 18): repair.cancelPendingAppBundleUpdateHandoff 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, 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":"internal/repair/update.go"},"region":{"startLine":1197}}}],"partialFingerprints":{"codehealthFindingId/v1":"28b742c8b89965d95d34f4ea3f8e1a867f93fc7f415ab34286eb20510e6e6e97"}},{"ruleId":"D1","level":"warning","message":{"text":"sandbox.consumeNullRedirect (cyclomatic 18): sandbox.consumeNullRedirect 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":"internal/sandbox/shell.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"b82b6fca7d1977f2c00d48d19d31921c7980cc1065e691f5441e1470c4ced7ef"}},{"ruleId":"D1","level":"warning","message":{"text":"serve.safeRedirectTarget (cyclomatic 18): serve.safeRedirectTarget 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":"internal/serve/auth.go"},"region":{"startLine":403}}}],"partialFingerprints":{"codehealthFindingId/v1":"095187e6eb9e8ed8e64cd8f29a15f87b5dae60dafb319b439d3462cd8a43b2a0"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.deleteSession (cyclomatic 18): Server.deleteSession has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/serve/serve.go"},"region":{"startLine":1487}}}],"partialFingerprints":{"codehealthFindingId/v1":"62d0138a8ef7ac0632ed2003b77a443ee364e570093b2a036e56f4e1620953be"}},{"ruleId":"D1","level":"warning","message":{"text":"shellparse.AnalyzeApprovalFeatures (cyclomatic 18): shellparse.AnalyzeApprovalFeatures has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/shellparse/bash.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c91efc1be379a07e3e25f195afc2668aa8920c80abfaa6708b73af284478463"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.validateMutablePath (cyclomatic 18): Store.validateMutablePath 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":"internal/skill/skill.go"},"region":{"startLine":1109}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbd622f0854ff6258a1eb469f85570f81873d41fbe3635c3273c963612f1199f"}},{"ruleId":"D1","level":"warning","message":{"text":"TmuxAdapter.Attach (cyclomatic 18): TmuxAdapter.Attach has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/taskmonitor/tmux.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"41c864806c046e41bb75f5202fcbf7bd6146af09bdf47d2c5077021bc9826c39"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.htmlToText (cyclomatic 18): builtin.htmlToText 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":"internal/tool/builtin/webfetch.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"acdfc68a4523862d0797a23acf6c9e27eca98d298305a59312d55558670c76fb"}},{"ruleId":"D1","level":"warning","message":{"text":"bash.Execute (cyclomatic 18): bash.Execute has cyclomatic complexity 18 (threshold 15). Of this number, 14 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":"internal/tool/builtin/bash.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0b0bfaa6892dc285e04951aa2675edbb721b44d2bb68e9639c4bb1c95b21180"}},{"ruleId":"D1","level":"warning","message":{"text":"worktree.inspect (cyclomatic 18): worktree.inspect has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/worktree/worktree.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe95324ac0dae6055c0f08c6f713bbbe7b53ac90af1dc13e9e0f498c6707dca7"}},{"ruleId":"D1","level":"warning","message":{"text":"main.finalizeServerView (cyclomatic 17): main.finalizeServerView 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":"desktop/app.go"},"region":{"startLine":8333}}}],"partialFingerprints":{"codehealthFindingId/v1":"532ca6342881c72e77b33767853da53f0e12acc9e12d5e6b9494423e2e67b3d7"}},{"ruleId":"D1","level":"warning","message":{"text":"main.removeEnvFile (cyclomatic 17): main.removeEnvFile 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":"desktop/dotenv.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4989c4e869e7e6b82c2e4c532b2af2c067b5a72a0b528a6b1e8e0add3f52924"}},{"ruleId":"D1","level":"warning","message":{"text":"main.validateRemoteHostEntry (cyclomatic 17): main.validateRemoteHostEntry 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":"desktop/remote_hosts.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"8796e916d4bac75b717db1b761335ad10b12ab94c40ccb49b2ccaa0cc980cfdf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.trashSessionArtifactsBeforeMove (cyclomatic 17): main.trashSessionArtifactsBeforeMove 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":"desktop/sessions.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"b869ff45fbffd26d710870e41ab2c224b276c5ff4fa026ef172fee004351d041"}},{"ruleId":"D1","level":"warning","message":{"text":"main.sniffThemeImageMIME (cyclomatic 17): main.sniffThemeImageMIME 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":"desktop/theme_image.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e4f6938417930b02224794811d843b088254a8c9cda8f81ad32eb9320606313"}},{"ruleId":"D1","level":"warning","message":{"text":"App.canReclaimCurrentProcessSessionLease (cyclomatic 17): App.canReclaimCurrentProcessSessionLease 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":"desktop/app.go"},"region":{"startLine":9892}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e67181ed36c61be29ae7a21a36707642d8afc1eec564aec5a1eed648a0c8519"}},{"ruleId":"D1","level":"warning","message":{"text":"App.WorkspaceConflictForTab (cyclomatic 17): App.WorkspaceConflictForTab 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":"desktop/background_runtime.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc413b8d95fafcf7277ad5915eefedc6891984e2a86940ee6361227fa2c8f065"}},{"ruleId":"D1","level":"warning","message":{"text":"App.claimSessionRuntime (cyclomatic 17): App.claimSessionRuntime has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/session_runtime.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b15307af5070255edc7bec548a7ef0ac5a93bbb69e349dd7b815fff452f9f58"}},{"ruleId":"D1","level":"warning","message":{"text":"App.TrySubagentProfile (cyclomatic 17): App.TrySubagentProfile 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":"desktop/subagents_app.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a6ff94578d0aff8edeebbb5641baf837674e3d4e718fcaa4bea7cf04a8794b1"}},{"ruleId":"D1","level":"warning","message":{"text":"App.deleteTopic (cyclomatic 17): App.deleteTopic 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":"desktop/tabs.go"},"region":{"startLine":7376}}}],"partialFingerprints":{"codehealthFindingId/v1":"51b70f39efd230f5c37babfb2ce8f9faa84af73b15a0fa46df4b9484ebfa817f"}},{"ruleId":"D1","level":"warning","message":{"text":"App.ImportThemePack (cyclomatic 17): App.ImportThemePack 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":"desktop/theme_app.go"},"region":{"startLine":641}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6141e9fedd8609cac5bbc222565592086679969d827e33aa410560715782af4"}},{"ruleId":"D1","level":"warning","message":{"text":"main.comprehension (cyclomatic 17): main.comprehension 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":"benchmarks/context-maintenance-e2e/main.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f12af38027ffab772dfdf4b0247e046d2e4e9626d7008b6f483647502944623"}},{"ruleId":"D1","level":"warning","message":{"text":"main.migrateWithRelaunch (cyclomatic 17): main.migrateWithRelaunch 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":"cmd/reasonix-legacy-migrator/main.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c67255d89daca3ec097fc11b598158aa207791e68adb008459e1be4d9a2ccc8"}},{"ruleId":"D1","level":"warning","message":{"text":"service.sessionList (cyclomatic 17): service.sessionList has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"internal/acp/service.go"},"region":{"startLine":2001}}}],"partialFingerprints":{"codehealthFindingId/v1":"545ddcc1339ead609ba28d83f08ea2ded25965035b083ccfb24c543c513cc11d"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.New (cyclomatic 17): agent.New 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":"internal/agent/agent.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"da7fd9b1b324816e0c1a03c3c26c02e2eab68baa5e88e8af576b1b85a68f2d70"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.deliveryTaskStartsWithMutation (cyclomatic 17): agent.deliveryTaskStartsWithMutation has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":2342}}}],"partialFingerprints":{"codehealthFindingId/v1":"190d72933dd56e47bb70947846c737eb37449ef2be4738a41d84656010efe364"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.ReclaimableRecoveryBranches (cyclomatic 17): agent.ReclaimableRecoveryBranches 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":"internal/agent/recovery_gc.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff5234622fd5ca01edb17c1ffcf3790edd35b5f23ceb64a996643ec9b4242678"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.probeSessionEventLogWithLimits (cyclomatic 17): agent.probeSessionEventLogWithLimits 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":"internal/agent/session_events.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"90d979070fd606172c9453f3db7a9a56d6713669f888c20f458c7912fcc44bc4"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.repairSessionEventLogTail (cyclomatic 17): agent.repairSessionEventLogTail 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":"internal/agent/session_events.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"27000ab229f59ead806ff853226c177ac5726aed677f510e0a1209dfe87bfa4e"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.RunSubAgentWithSession (cyclomatic 17): agent.RunSubAgentWithSession 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":"internal/agent/task.go"},"region":{"startLine":1873}}}],"partialFingerprints":{"codehealthFindingId/v1":"7efca494317ebfc34102d8ff192934eb9d381ce2a4d2d28b2e2352ba244c7582"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.updateDeliveryCheckpoint (cyclomatic 17): Agent.updateDeliveryCheckpoint 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":"internal/agent/agent.go"},"region":{"startLine":1788}}}],"partialFingerprints":{"codehealthFindingId/v1":"b220ee8d329b5c9618678f817eba79a3dd065de2253c8ef2f3d64dd02e5c60e0"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.RecordDirection (cyclomatic 17): Store.RecordDirection 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":"internal/autoresearch/store.go"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"7455da217e976cdcb98f78ec80ecae70adbba4e6d290bece9e1432e52a0e971b"}},{"ruleId":"D1","level":"warning","message":{"text":"toolSourceConnector.availableSources (cyclomatic 17): toolSourceConnector.availableSources 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":"internal/boot/token_profile.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb513903744e0d872f4a36de17fe7aa71b1d66d07fe0faa069cb4562050e6677"}},{"ruleId":"D1","level":"warning","message":{"text":"botruntime.rememberInbound (cyclomatic 17): botruntime.rememberInbound 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":"internal/botruntime/runtime.go"},"region":{"startLine":513}}}],"partialFingerprints":{"codehealthFindingId/v1":"4595e516d184f1ca40439fb8c2d5ea2c492d639c29613ac9d2933fb929800648"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.CaptureBeforeFromChange (cyclomatic 17): Store.CaptureBeforeFromChange 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"122d04d0f0140e0ce19d54dff1ef83d4688e32ee5f92fe775bc672370528d289"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.gcLocked (cyclomatic 17): Store.gcLocked 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dbc61f0272cb66652ad8ace541d1db15ac727ecb30e570e0aaa07580568737b"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.coverageFromTurnLocked (cyclomatic 17): Store.coverageFromTurnLocked 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1394}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6604962b708e3c5979ca8908db34c3be7d009151c476e0e9c9950a0fe5442cf"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.PrepareFileRevert (cyclomatic 17): Store.PrepareFileRevert 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1531}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b62519ead1fc5ac6170c5cd8602436887f4fd790e1640349bab79c34c742c9f"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.convertCommand (cyclomatic 17): cli.convertCommand 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":"internal/cli/latex.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ac60718d1f389d399580b2b80b47bb4498ccc9f57e1635614f89c716fe64757"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.remoteServeCLI (cyclomatic 17): cli.remoteServeCLI 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":"internal/cli/remote_connect.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbb5588ad573ae7bdcbefc3ec10a534c44c5d4292b183af8c16255cff123a79a"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.machineTasks (cyclomatic 17): cli.machineTasks 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":"internal/cli/task_machine.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"14d842d442ac25073cc0af9a27d717dd977b66662480e5950dca5c5807990ee5"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.streamToolOutput (cyclomatic 17): chatTUI.streamToolOutput 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":"internal/cli/chat_tui.go"},"region":{"startLine":2339}}}],"partialFingerprints":{"codehealthFindingId/v1":"24fb4509e810a0b09ed6a3ee8e4cdb63849a68beadb507eeda5de2f6aeaf425b"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.skillSaveEnabledChanges (cyclomatic 17): chatTUI.skillSaveEnabledChanges has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/skill_hooks.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"0376d5c2e11d7b0fb745fff4a39cce09e05c1837feb2fd50057eea04ca271e14"}},{"ruleId":"D1","level":"warning","message":{"text":"config.removeTOMLSectionKey (cyclomatic 17): config.removeTOMLSectionKey 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":"internal/config/edit.go"},"region":{"startLine":2150}}}],"partialFingerprints":{"codehealthFindingId/v1":"c67b0771bd0e7aa663d49843800c8e3735ae6bd11c8ebfd6a76951f534a62a90"}},{"ruleId":"D1","level":"warning","message":{"text":"config.advanceTOMLStringState (cyclomatic 17): config.advanceTOMLStringState has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/load.go"},"region":{"startLine":1071}}}],"partialFingerprints":{"codehealthFindingId/v1":"71114cc1158b022b5c4ca5032d8f2a2ab9deed956ce49bc4b267e1c156dd9559"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.RemoveProvider (cyclomatic 17): Config.RemoveProvider 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":"internal/config/edit.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d415469fbebcf817419b9ed277d6478f781fc476c14866bb60abb38795bfae8"}},{"ruleId":"D1","level":"warning","message":{"text":"control.readAttachmentImage (cyclomatic 17): control.readAttachmentImage 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":"internal/control/attachments.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d209f3afb2658e684644d500b862a2ed878186e6178f4e134739de7596f15bd"}},{"ruleId":"D1","level":"warning","message":{"text":"control.MemoryCommandText (cyclomatic 17): control.MemoryCommandText 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":"internal/control/memory_command.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1e3a8d1239f2b1ace45ce1b9b9da25280f97d7f93465e8ffbdb0219baa50094"}},{"ruleId":"D1","level":"warning","message":{"text":"control.RenderMemorySummary (cyclomatic 17): control.RenderMemorySummary 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":"internal/control/memory_command.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"35a39f9395a9ec7ed939670e34bde4ebf2ad31d390aa12359082b8ef5386574a"}},{"ruleId":"D1","level":"warning","message":{"text":"control.readFileRef (cyclomatic 17): control.readFileRef 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":"internal/control/refs.go"},"region":{"startLine":968}}}],"partialFingerprints":{"codehealthFindingId/v1":"70ad2253607fea2d9c17367f6a621fe79b2d0ed356eabe235f853028312364b2"}},{"ruleId":"D1","level":"warning","message":{"text":"protocolgen.renderSDKType (cyclomatic 17): protocolgen.renderSDKType 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":"internal/extension/protocolgen/sdkgo.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"0329d8bed2bed7a650553a52556822498dad17e4da166eecd6b9ad1cd4fd1597"}},{"ruleId":"D1","level":"warning","message":{"text":"sdkTypeWalk.visit (cyclomatic 17): sdkTypeWalk.visit 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":"internal/extension/protocolgen/sdkgo.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4bac15929a6cdff502a5f4a0101e256ea3e75c8883a0d85cc5ac620db18f39f"}},{"ruleId":"D1","level":"warning","message":{"text":"uihub.AskRequestFunc (cyclomatic 17): uihub.AskRequestFunc has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 625). 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":"internal/extension/uihub/hub.go"},"region":{"startLine":624}}}],"partialFingerprints":{"codehealthFindingId/v1":"29cf2007bd3fd7f7561a39b7424a56c410153ebe147cd6f3a593d015d80ebde4"}},{"ruleId":"D1","level":"warning","message":{"text":"hook.ParseOutput (cyclomatic 17): hook.ParseOutput 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":"internal/hook/hook.go"},"region":{"startLine":987}}}],"partialFingerprints":{"codehealthFindingId/v1":"b94575ed838c5f4764415b9e6b7f727d44319ec6ad81ad1d28e40f426aa53389"}},{"ruleId":"D1","level":"warning","message":{"text":"installsource.parseMCPJSON (cyclomatic 17): installsource.parseMCPJSON 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":"internal/installsource/mcp.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"d44e56c205986e671ff0b0466de82fc095953e9f6574aac4d224c8616bae7826"}},{"ruleId":"D1","level":"warning","message":{"text":"installsource.scanSkillRoot (cyclomatic 17): installsource.scanSkillRoot has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 232). 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":"internal/installsource/skill.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"592741aeb024a9d7b51e7b4ee6865b2e85115d62d11941abbfdc098ebe55e116"}},{"ruleId":"D1","level":"warning","message":{"text":"memory.AssessRememberWrite (cyclomatic 17): memory.AssessRememberWrite 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":"internal/memory/remember_policy.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbba61fe9730e988b8b369afb2becb2070704b47cca6faae081675180e42dcbd"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.findArchivedByPath (cyclomatic 17): Store.findArchivedByPath 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":"internal/memory/store_v2.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"a974fbcfcbaf634350168041d871aef6aa10b2fbeb7d538dc01fea9ff9e73ca5"}},{"ruleId":"D1","level":"warning","message":{"text":"lazyTool.Execute (cyclomatic 17): lazyTool.Execute 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":"internal/plugin/lazy.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fac557b725115b68d409c3e569fdfd836e301955720c5e0c103ec82585f748f"}},{"ruleId":"D1","level":"warning","message":{"text":"Package.scanSkillPath (cyclomatic 17): Package.scanSkillPath 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":"internal/pluginpkg/pluginpkg.go"},"region":{"startLine":1099}}}],"partialFingerprints":{"codehealthFindingId/v1":"57750448c5ea9214d6931d705e5578d560709353292a9fe8ec213daaa9a13dd0"}},{"ruleId":"D1","level":"warning","message":{"text":"openai.normaliseUsage (cyclomatic 17): openai.normaliseUsage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/provider/openai/openai.go"},"region":{"startLine":1141}}}],"partialFingerprints":{"codehealthFindingId/v1":"26d8916d1369ec25fa383ffac5935c609b4671650ebf4c3be438b48fa9897db2"}},{"ruleId":"D1","level":"warning","message":{"text":"provider.closeTruncatedJSON (cyclomatic 17): provider.closeTruncatedJSON 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":"internal/provider/provider.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"2447ff12eceab4215b6d0091c43bf925698a2977473fc3d86362487c315a1445"}},{"ruleId":"D1","level":"warning","message":{"text":"HostKeyPolicy.HostKeyAlgorithms (cyclomatic 17): HostKeyPolicy.HostKeyAlgorithms 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":"internal/remote/knownhosts.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3265780e9548da79d6a580ca11b166e28acd7b6dcc9c495d503bf1337e4e7ec"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.ArchiveSupersededPendingFileUpdate (cyclomatic 17): repair.ArchiveSupersededPendingFileUpdate has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"internal/repair/update_legacy.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d6c67d4ac8cf6516a14ed86f1c9f10f2f9b7cabf25845a29786b94671019611"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.resume (cyclomatic 17): Server.resume 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":"internal/serve/serve.go"},"region":{"startLine":1107}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb6d7762c85fb479576dad5c4ee94a6bea5efb218a0ddeaa7079851e237f8c8a"}},{"ruleId":"D1","level":"warning","message":{"text":"shellparse.IsAssignment (cyclomatic 17): shellparse.IsAssignment 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":"internal/shellparse/bash.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4ba3dbcbd6c89da9459fc611d304bfab4bdeaa7c7d3ebe2cb4d0cb9419f74e0"}},{"ruleId":"D1","level":"warning","message":{"text":"skill.bindAllowedTools (cyclomatic 17): skill.bindAllowedTools 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":"internal/skill/skill.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"17ea8eb4c22b0dead81f3c20c79afe5e701244d001608435906cd998833b9e5a"}},{"ruleId":"D1","level":"warning","message":{"text":"Recorder.Emit (cyclomatic 17): Recorder.Emit 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":"internal/stats/recorder.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"3baf1433f40e4d8d24a8eb5201c1a27503d5437e3d247fbdde3f2c0255955454"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.allCommandHints (cyclomatic 17): builtin.allCommandHints 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":"internal/tool/builtin/completestep.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fff46501480e408bb4a52a91e2d42548a542fdfa3450ab770f67ae97d4c4bec"}},{"ruleId":"D1","level":"warning","message":{"text":"deleteSymbol.findSymbol (cyclomatic 17): deleteSymbol.findSymbol 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":"internal/tool/builtin/delete_symbol.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ae425b1a15fb8d617f30a5b92611d6fd185898c9d71d2ca1e25589e24e4700d"}},{"ruleId":"D1","level":"warning","message":{"text":"main.upsertEnvFile (cyclomatic 16): main.upsertEnvFile 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":"desktop/dotenv.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"494a44f88049d42abcb89e725cfde41e40a546fd5124df2631286c99081cc71c"}},{"ruleId":"D1","level":"warning","message":{"text":"main.classifyProviderPresetStatus (cyclomatic 16): main.classifyProviderPresetStatus 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":"desktop/settings_app.go"},"region":{"startLine":755}}}],"partialFingerprints":{"codehealthFindingId/v1":"d702fd997ff35b1a5c71c86aad8e5daa7c5de7b7939ddd3fd7e6ea1a9ccb2317"}},{"ruleId":"D1","level":"warning","message":{"text":"main.applyRuntimeTab (cyclomatic 16): main.applyRuntimeTab 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":"desktop/tabs.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b576115616ab221385c91c4adf384b50b55777a478f8cf798ed72dd9b8f5d5a"}},{"ruleId":"D1","level":"warning","message":{"text":"main.scanThemeZipEntries (cyclomatic 16): main.scanThemeZipEntries 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":"desktop/theme_import.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"63bd3cbe230657fe92adecf949f3265aeea4a5d7165d029b78c58eff5b783a19"}},{"ruleId":"D1","level":"warning","message":{"text":"App.domReady (cyclomatic 16): App.domReady has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 6 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":"desktop/app.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e25fccbe75316266415f72cee3984e16e2942ed905f805f178bed784a685cbb"}},{"ruleId":"D1","level":"warning","message":{"text":"App.buildSessionRebindCandidate (cyclomatic 16): App.buildSessionRebindCandidate 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":"desktop/app.go"},"region":{"startLine":4557}}}],"partialFingerprints":{"codehealthFindingId/v1":"70ac8e7ae787e41b070eb37b812847deb5abf75318eb93270f886dcf2750d66f"}},{"ruleId":"D1","level":"warning","message":{"text":"App.ReadFileForTab (cyclomatic 16): App.ReadFileForTab 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":"desktop/app.go"},"region":{"startLine":10799}}}],"partialFingerprints":{"codehealthFindingId/v1":"496d7f7d98827bcbe239c262d8c378fa12e7b91d340980f399bf6cb8fbf7c219"}},{"ruleId":"D1","level":"warning","message":{"text":"App.sessionParentLiveForBuild (cyclomatic 16): App.sessionParentLiveForBuild has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/session_runtime.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"39846a01e48202e2ccbe87e1750a612c4373983bb34c9e43dd979f3fcff1aa67"}},{"ruleId":"D1","level":"warning","message":{"text":"App.AddProviderPresetAccess (cyclomatic 16): App.AddProviderPresetAccess has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"desktop/settings_app.go"},"region":{"startLine":2606}}}],"partialFingerprints":{"codehealthFindingId/v1":"85c2605569c0a7d634ac8030702268fc13485e518dc14a05d8a554f3da7cd882"}},{"ruleId":"D1","level":"warning","message":{"text":"App.trashTopic (cyclomatic 16): App.trashTopic has cyclomatic complexity 16 (threshold 15). 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 7519). 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":"desktop/tabs.go"},"region":{"startLine":7512}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e4d9f269cfcab4440a197ff46210a95a0a96856ff77684e461d90ed87d0c340"}},{"ruleId":"D1","level":"warning","message":{"text":"App.topicTrashTargets (cyclomatic 16): App.topicTrashTargets has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"desktop/tabs.go"},"region":{"startLine":7594}}}],"partialFingerprints":{"codehealthFindingId/v1":"e726f620aa9f76516ef0857f7a624f7e958c138b0b0f5a1d9e8c6de1f780fc70"}},{"ruleId":"D1","level":"warning","message":{"text":"desktopRemoteManager.EnsureServer (cyclomatic 16): desktopRemoteManager.EnsureServer 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":"desktop/remote_app.go"},"region":{"startLine":1305}}}],"partialFingerprints":{"codehealthFindingId/v1":"16a72d7e5992d3907265778d401b4fd6c8ca6672d140cecc262946fc688f8be6"}},{"ruleId":"D1","level":"warning","message":{"text":"main.render (cyclomatic 16): main.render 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/e2ebench/main.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e21bcb91adfeced9d2edb0c3e3d60f31cbaa1f7bd5302b8f6f4603d22e97c9d"}},{"ruleId":"D1","level":"warning","message":{"text":"main.discoverTopLevelSigningWorkflows (cyclomatic 16): main.discoverTopLevelSigningWorkflows has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 6 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":"cmd/signpath-contract/main.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"357cc7a42ccfd37841ffd9eee700cc5fa63b3c43ca179b44296bba035c8edd53"}},{"ruleId":"D1","level":"warning","message":{"text":"main.parseWorkflow (cyclomatic 16): main.parseWorkflow 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/signpath-contract/main.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7cd19b11bb429225855a96b63bab20bda74f00cfd740a2e132251245ad2b34e"}},{"ruleId":"D1","level":"warning","message":{"text":"service.switchSessionConfig (cyclomatic 16): service.switchSessionConfig has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 6 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":"internal/acp/service.go"},"region":{"startLine":1592}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a917ee1c0e1534cf5d39d711480416c71cb5d6d73f56aeefdc270cabab9863"}},{"ruleId":"D1","level":"warning","message":{"text":"agent.preflightSessionEventValue (cyclomatic 16): agent.preflightSessionEventValue 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":"internal/agent/session_events.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fb9cd4591605304161b39aeecfb91e742634fb00bafc300a39219a7ca9e04a9"}},{"ruleId":"D1","level":"warning","message":{"text":"Agent.handleFinalResponse (cyclomatic 16): Agent.handleFinalResponse 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":"internal/agent/run_loop.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd965a7b0a115deebd9df8dcbf16273d85ef3d24129c1043b6850a0cf9758819"}},{"ruleId":"D1","level":"warning","message":{"text":"bot.saveOneInboundMedia (cyclomatic 16): bot.saveOneInboundMedia 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":"internal/bot/media.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"c47e32acb16f33d48e41ffb09e7d843f65f56c7163a8f197617de36a8ef92f5a"}},{"ruleId":"D1","level":"warning","message":{"text":"adapter.parsePostContent (cyclomatic 16): adapter.parsePostContent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/feishu/inbound.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"5eb207e8b82d5815071986717bc6704d34d0339ceccf46e2a9180b0f97449408"}},{"ruleId":"D1","level":"warning","message":{"text":"capdiag.mergeRuntimeHost (cyclomatic 16): capdiag.mergeRuntimeHost 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":"internal/capdiag/collect.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"dde250d2059c22b79f620e207aac84c201d1c7b925f338a6f644cd9c77d0fcdb"}},{"ruleId":"D1","level":"warning","message":{"text":"checkpoint.CapturePath (cyclomatic 16): checkpoint.CapturePath 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":"internal/checkpoint/capture.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"64c9a45240be55890da21e7a956de4ae626f7d6ab954cd3c6f4518f7739f7e37"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.load (cyclomatic 16): Store.load has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 266). 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"326925f00c5d7a021574bdc3f9795e03fdc097ce41e9b7f489d9b16d60e89ebf"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.precheckFiles (cyclomatic 16): Store.precheckFiles 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1294}}}],"partialFingerprints":{"codehealthFindingId/v1":"c285ea9f3bd024d88434f678c72320159fc26573a67159f65f97827f3d9f8830"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.recoverOrphanedPasteLabelsFromHistory (cyclomatic 16): cli.recoverOrphanedPasteLabelsFromHistory 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":"internal/cli/chat_tui_paste.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3f14318530bb3af6f35b2298a3d6c5bb0e0320ceeca7a97780e24b9996a9b1"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.appendEnv (cyclomatic 16): cli.appendEnv 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":"internal/cli/cli.go"},"region":{"startLine":2288}}}],"partialFingerprints":{"codehealthFindingId/v1":"686593c8f1806ef85d04e1bffd3793f4991f5ac9316ae41f16479a0b8e34198e"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.configReasoningLanguageCommand (cyclomatic 16): cli.configReasoningLanguageCommand 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":"internal/cli/cli.go"},"region":{"startLine":2531}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcf86595e9a093cafc604a93df94a9fa080b349e8d4577de195e0f185156f2d5"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.diffBody (cyclomatic 16): cli.diffBody 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":"internal/cli/diffview.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4b084114de3309dc6947f9a2acc005173008c3066c6c1259614621dca551338"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.docsManifestCommand (cyclomatic 16): cli.docsManifestCommand 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":"internal/cli/docs_manifest.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"a71ba569ac6a8f56eb90189babaf347ebdc1aaff562369051b0305fc250315aa"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.doctorCapabilitiesCommand (cyclomatic 16): cli.doctorCapabilitiesCommand 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":"internal/cli/doctor_capabilities.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeca3e3e5e2cf12a894f51c5bf4a4f328bf5e7bec4ce9d835c83efffe72ec840"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.pastedPathCandidates (cyclomatic 16): cli.pastedPathCandidates has cyclomatic complexity 16 (threshold 15). 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: 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":"internal/cli/pasted_path.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"82f375efbe683467c3d3a49d3257b1474c0ffec0ea72293e789d25a2ef6bb4f1"}},{"ruleId":"D1","level":"warning","message":{"text":"cli.queryTerminalBackground (cyclomatic 16): cli.queryTerminalBackground 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":"internal/cli/theme_osc_unix.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"749ae138e210a9edaed155b362643dc99a92b0b39086880f95c836877592ade2"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.collapseToolOutput (cyclomatic 16): chatTUI.collapseToolOutput 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":"internal/cli/chat_tui.go"},"region":{"startLine":2689}}}],"partialFingerprints":{"codehealthFindingId/v1":"56440beedcefd9d3983c161b663bc6f7e4f87b4549f18f6f826e8f31b3373890"}},{"ruleId":"D1","level":"warning","message":{"text":"chatTUI.buildMCPSnapshot (cyclomatic 16): chatTUI.buildMCPSnapshot 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":"internal/cli/mcp_manager.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"d14f6b6022ac99bbc80a8e405afd08742dc1df7ea54560420c2908b034bff722"}},{"ruleId":"D1","level":"warning","message":{"text":"config.classifyMCPImportCandidate (cyclomatic 16): config.classifyMCPImportCandidate 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":"internal/config/ccswitch.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"84b5168ca90ef90afee2766305ef4ad2e94771fa7184bd32672eb6727836d734"}},{"ruleId":"D1","level":"warning","message":{"text":"config.InstallUserPluginForRoot (cyclomatic 16): config.InstallUserPluginForRoot 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":"internal/config/edit.go"},"region":{"startLine":1071}}}],"partialFingerprints":{"codehealthFindingId/v1":"0464c4482869c6c6bddd9d280972adca788f925d526a4b76e9a429b5e9cd1ae7"}},{"ruleId":"D1","level":"warning","message":{"text":"config.upsertTOMLSectionKey (cyclomatic 16): config.upsertTOMLSectionKey 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":"internal/config/edit.go"},"region":{"startLine":1892}}}],"partialFingerprints":{"codehealthFindingId/v1":"37992de56d9718c52ee134cbc4075769eeaa7f0bbace0049d4f5a3cfd54e82d4"}},{"ruleId":"D1","level":"warning","message":{"text":"config.migrateMCPToUserConfig (cyclomatic 16): config.migrateMCPToUserConfig has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/migrate.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"342cd661e4f9b59662c8b08cd803ef953c4164ad56a8157ca381831428652951"}},{"ruleId":"D1","level":"warning","message":{"text":"control.completeToolTurnEnd (cyclomatic 16): control.completeToolTurnEnd 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":"internal/control/controller.go"},"region":{"startLine":4724}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0e31c057fccbb6b34f5f5c9b3158b563641b9402f8f43773bf5803b438c0371"}},{"ruleId":"D1","level":"warning","message":{"text":"control.interruptedToolSummary (cyclomatic 16): control.interruptedToolSummary has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. 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":"internal/control/controller.go"},"region":{"startLine":4777}}}],"partialFingerprints":{"codehealthFindingId/v1":"52a0d0e800b2ed35ffbeefdb7aea2d636f63d8dfae1ef14be0750dcc9ff61f58"}},{"ruleId":"D1","level":"warning","message":{"text":"control.plannerDirectiveText (cyclomatic 16): control.plannerDirectiveText 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":"internal/control/planner_gate.go"},"region":{"startLine":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a1d2ee8f0b0c5554f0517b55c9b2a3fc081b7c07a48090f7eee6963d0d7664d"}},{"ruleId":"D1","level":"warning","message":{"text":"control.safeExternalFolderRefComponent (cyclomatic 16): control.safeExternalFolderRefComponent 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":"internal/control/refs.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"47f766be6d8000ee97126d15fec64bf9cc85a4218b2c1ae86d7bb0ffb154725c"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.ClearSession (cyclomatic 16): Controller.ClearSession has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent 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":"internal/control/controller.go"},"region":{"startLine":3233}}}],"partialFingerprints":{"codehealthFindingId/v1":"998d028519eaf837e1ae6269eb05984b33cf4d93164cfdc1e835f2a9c07d5059"}},{"ruleId":"D1","level":"warning","message":{"text":"gateApprover.approveWithPolicyReason (cyclomatic 16): gateApprover.approveWithPolicyReason 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":"internal/control/controller.go"},"region":{"startLine":5981}}}],"partialFingerprints":{"codehealthFindingId/v1":"268e0fed3721350c341fe89e4f7264a892d928424efae028a34464a4bc9be5ee"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.validateSerialSegment (cyclomatic 16): evidence.validateSerialSegment 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":"internal/evidence/evidence.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8ccd31a23b91569ba36860a4382ffe8677673a58d433eac833b99b7f9888d96"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.receiptsReviewChanges (cyclomatic 16): evidence.receiptsReviewChanges 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":"internal/evidence/evidence.go"},"region":{"startLine":947}}}],"partialFingerprints":{"codehealthFindingId/v1":"fffda0f8f6271cca016cb6e42826b4675a99edd8796d57195d90068ffad6b1e5"}},{"ruleId":"D1","level":"warning","message":{"text":"evidence.BashToolCallUsesOpaqueInlineInterpreter (cyclomatic 16): evidence.BashToolCallUsesOpaqueInlineInterpreter 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":"internal/evidence/evidence.go"},"region":{"startLine":1726}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ce7a6da6300d7417aa1fa844a99163993c19ae8d92db1e505ef260a7ce4aedc"}},{"ruleId":"D1","level":"warning","message":{"text":"protocol.validateTag (cyclomatic 16): protocol.validateTag 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":"internal/extension/protocol/validate.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb3d6884f040748140d8866ec39f65cdc4c26eeb7f01ea06bd425078caac0930"}},{"ruleId":"D1","level":"warning","message":{"text":"hook.shellField (cyclomatic 16): hook.shellField 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":"internal/hook/command_normalize.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca2c753968d7a732b90dc85c36b3aaf638413e3d189602d156bd3d03b321c9cc"}},{"ruleId":"D1","level":"warning","message":{"text":"installsource.sanitizeName (cyclomatic 16): installsource.sanitizeName 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":"internal/installsource/names.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"5840657f73fb65ab0686915ab4c1e49ffa5a2fb7d14706924e149466a6041fae"}},{"ruleId":"D1","level":"warning","message":{"text":"installSourceTool.tryGitHubRepo (cyclomatic 16): installSourceTool.tryGitHubRepo 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":"internal/installsource/plan.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff3c81247b4e649283b7b95edb786a302ed852f936685e3e59fcf18079bd4e83"}},{"ruleId":"D1","level":"warning","message":{"text":"instruction.Resolve (cyclomatic 16): instruction.Resolve has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"internal/instruction/resolver.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f5197fc4c10742fe498d54adda957a00bc08fe8d23c12e4e0e4265a086b8adf"}},{"ruleId":"D1","level":"warning","message":{"text":"plugin.resolvePyPIPackage (cyclomatic 16): plugin.resolvePyPIPackage 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":"internal/plugin/launcher_lock.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"8645bae30ca5fca0c1495338a76bce2f1d12b4a5d98c74b39651262317925111"}},{"ruleId":"D1","level":"warning","message":{"text":"plugin.normalizeIdentityURL (cyclomatic 16): plugin.normalizeIdentityURL 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":"internal/plugin/security.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"828a6aa31e4bdcc629b9c73aecd1cf6839a9c39d6ba55c7796b058438513cc05"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.Resolve (cyclomatic 16): Gate.Resolve 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":"internal/recovery/gate.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d281d603a6360ab3471c227d54221baafaf919fcf8b280ffadc6d493c350fc6"}},{"ruleId":"D1","level":"warning","message":{"text":"Gate.reviewOrEscalate (cyclomatic 16): Gate.reviewOrEscalate 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":"internal/recovery/gate.go"},"region":{"startLine":927}}}],"partialFingerprints":{"codehealthFindingId/v1":"af295c5f82e885103b0d72b1bfe49d29cf43835c0d177c4209fd882a34792d9c"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.Diagnose (cyclomatic 16): repair.Diagnose 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":"internal/repair/diagnose.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2b9fe56b93536071bb684a8dbd45c9202995679dda3d9298f2bf2cb9da1e157"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateProviders (cyclomatic 16): repair.validateProviders 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":"internal/repair/diagnose.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"36d6466a5d8bf4e856a3d3ca5de823f6e7a62f0592d0af28d907771cbac061c9"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.probeProviderNetwork (cyclomatic 16): repair.probeProviderNetwork 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":"internal/repair/diagnose.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"46d1e32e7fe7a2d3a7f3432fcb2ecdc2b1e7db8ef187ee8a030c3f764c7fc75e"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.PreviewRepairPlan (cyclomatic 16): repair.PreviewRepairPlan 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":"internal/repair/plan.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"696b2c4106f2179ba370ea9275af3ae4f9e7a587b1036b3bead7090edd938b16"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.PrepareAppBundleUpdateHandoff (cyclomatic 16): repair.PrepareAppBundleUpdateHandoff 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":"internal/repair/update.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"29521b760538bd7dfb3ce28d6676e99d85bb8f2c18c7ef75a04cf9d6fb632dd3"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.installedFileUpdateTargets (cyclomatic 16): repair.installedFileUpdateTargets 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":"internal/repair/update.go"},"region":{"startLine":1082}}}],"partialFingerprints":{"codehealthFindingId/v1":"69ce1e7c893fed8ea2e58c336cce30d324d4f340a02c8edaf0eccb1d7969ff79"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.ReconcilePendingUpdate (cyclomatic 16): repair.ReconcilePendingUpdate 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":"internal/repair/update.go"},"region":{"startLine":1881}}}],"partialFingerprints":{"codehealthFindingId/v1":"e88285f282996e5abf07f66255a966fd9eb155b5d49d045266568787910de25f"}},{"ruleId":"D1","level":"warning","message":{"text":"repair.validateOrphanedAppBundleBackupMetadata (cyclomatic 16): repair.validateOrphanedAppBundleBackupMetadata 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":"internal/repair/update.go"},"region":{"startLine":3308}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cab7a66eb977ca6304dc7e06584b45e6fbb14a5c83761d60693b6e9ee5fc176"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.generateTitle (cyclomatic 16): Server.generateTitle has cyclomatic complexity 16 (threshold 15). 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, 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":"internal/serve/serve.go"},"region":{"startLine":1391}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c6afce7663c17f162c37a5d6ed869c0d81124f9cbc8d1a81fd6e004c1b15e76"}},{"ruleId":"D1","level":"warning","message":{"text":"FileStore.RecordIdempotency (cyclomatic 16): FileStore.RecordIdempotency 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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":693}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c7746a798085ff5c7e0d8baa9b247ce60c68d18c7735ddfc6097e8756b966c3"}},{"ruleId":"D1","level":"warning","message":{"text":"TaskSnapshot.Validate (cyclomatic 16): TaskSnapshot.Validate 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":"internal/taskmonitor/model.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"30a1db469359a086fbba481ca387eabbd7a46334b2e896e76927aaf1a69ebc67"}},{"ruleId":"D1","level":"warning","message":{"text":"builtin.verifyTodoStep (cyclomatic 16): builtin.verifyTodoStep 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":"internal/tool/builtin/completestep.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7da4082afb301fb0b7f2dc8e408911aef4981ac4bebffdb70605eaabd5baeb8"}},{"ruleId":"D1","level":"warning","message":{"text":"writeFile.Execute (cyclomatic 16): writeFile.Execute 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":"internal/tool/builtin/writefile.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5e2be3d4ca104cc5dce7c5c40c9d9a922dfe7beeccafec04da076d50800c1e0"}},{"ruleId":"D1","level":"warning","message":{"text":"worktree.Create (cyclomatic 16): worktree.Create 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":"internal/worktree/worktree.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0bdfefc9386b86e0626acdf57361eb0a1b5cec83b2a4e3aba19509307171f29"}},{"ruleId":"D1","level":"warning","message":{"text":"extension.ReadContentRef (cyclomatic 16): extension.ReadContentRef 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":"sdk/go/sdk.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"acde5dfbcbc984e6ea8820740446a7ac8ebcdb2096de20fd3d7b30a3831bde0d"}},{"ruleId":"D2","level":"warning","message":{"text":"boot.build (cognitive 458): boot.build has cognitive complexity 458 (threshold 15). Drivers by points: if/else 359, loops 60, boolean chains 37, match/switch 2 (nesting depth added 149). Of this number, 274 points are the body\u0027s own statements and 184 belong to 28 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":"internal/boot/boot.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7cfc17318c166fb516e4a1c2c57bb57a4ce282e7e4f9ace8d00bc10ef817a8f"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.update (cognitive 446): chatTUI.update has cognitive complexity 446 (threshold 15). Drivers by points: if/else 373, boolean chains 36, match/switch 32, loops 4, jumps 1 (nesting depth added 244). To reduce it, split the body into named stages: move each independent 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":"internal/cli/chat_tui.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"15c1315ed21e060cc1abe4aac66a3756a3627c726b752201266bba4b3c6e9e02"}},{"ruleId":"D2","level":"warning","message":{"text":"config.RenderTOMLForScope (cognitive 368): config.RenderTOMLForScope has cognitive complexity 368 (threshold 15). Drivers by points: if/else 345, loops 19, boolean chains 3, match/switch 1 (nesting depth added 162). To reduce it, split the body into named stages: move each independent 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":"internal/config/render.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"99223782799f75c64f83bdae6242be956c007d21db7dd53d9f2e1d866807f123"}},{"ruleId":"D2","level":"warning","message":{"text":"config.RenderTOMLProjectDelta (cognitive 252): config.RenderTOMLProjectDelta has cognitive complexity 252 (threshold 15). Drivers by points: if/else 224, boolean chains 25, loops 3 (nesting depth added 111). To reduce it, split the body into named stages: move each independent 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":"internal/config/render.go"},"region":{"startLine":817}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb742a7a1bdeb8c141553286bd29d32c84f162c9a4d2aec7b035430af366d36c"}},{"ruleId":"D2","level":"warning","message":{"text":"client.readStream (cognitive 204): client.readStream has cognitive complexity 204 (threshold 15). Drivers by points: if/else 170, match/switch 23, boolean chains 7, loops 4 (nesting depth added 134). Of this number, 193 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/provider/responses/responses.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"df4549987728e155f6adc45b4d87aef1d44fb3254ec1e8c15f19af5336c62249"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.restoreReleaseUnit (cognitive 166): repair.restoreReleaseUnit has cognitive complexity 166 (threshold 15). Drivers by points: if/else 148, boolean chains 9, loops 9 (nesting depth added 89). Of this number, 163 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":"internal/repair/update.go"},"region":{"startLine":2784}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f5f2109cc6f09ca2a22bdb8b4e3cc52f9e785b8883e5d673f0cf5540e4e5adb"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.rollbackPendingUpdateMatchingLocked (cognitive 156): repair.rollbackPendingUpdateMatchingLocked has cognitive complexity 156 (threshold 15). Drivers by points: if/else 140, boolean chains 13, loops 2, match/switch 1 (nesting depth added 80). Of this number, 144 points are the body\u0027s own statements and 12 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":"internal/repair/update.go"},"region":{"startLine":2443}}}],"partialFingerprints":{"codehealthFindingId/v1":"94383f62695e4418372f4ebea3d4afb0f0c7231892d02d6fcf77e17196ccb273"}},{"ruleId":"D2","level":"warning","message":{"text":"App.buildTabControllerWithContextAdmissionHeld (cognitive 155): App.buildTabControllerWithContextAdmissionHeld has cognitive complexity 155 (threshold 15). Drivers by points: if/else 149, boolean chains 6 (nesting depth added 77). To reduce it, split the body into named stages: move each independent 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":"desktop/tabs.go"},"region":{"startLine":3567}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b36305b5e7f7fb724bff8f599d3049584dbb4817fc99e42d2608b94de2dd46f"}},{"ruleId":"D2","level":"warning","message":{"text":"BotGateway.handleSlashCommand (cognitive 144): BotGateway.handleSlashCommand has cognitive complexity 144 (threshold 15). Drivers by points: if/else 125, boolean chains 11, loops 7, match/switch 1 (nesting depth added 71). 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":"internal/bot/gateway.go"},"region":{"startLine":1332}}}],"partialFingerprints":{"codehealthFindingId/v1":"0af2f2b90d25dd37b1586735d2869e44803188e9abd5512cf32f3756018ea415"}},{"ruleId":"D2","level":"warning","message":{"text":"client.readStream (cognitive 121): client.readStream has cognitive complexity 121 (threshold 15). Drivers by points: if/else 103, match/switch 8, boolean chains 5, loops 5 (nesting depth added 67). Of this number, 111 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":"internal/provider/openai/openai.go"},"region":{"startLine":909}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c8c537b07c61a0ec99c730d4d8d5badd360ed86921ad67eebc876722e093f7e"}},{"ruleId":"D2","level":"warning","message":{"text":"client.readStream (cognitive 119): client.readStream has cognitive complexity 119 (threshold 15). Drivers by points: if/else 97, match/switch 17, boolean chains 3, loops 2 (nesting depth added 78). Of this number, 108 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/provider/anthropic/anthropic.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff5d0de7e3499bfb6c95bea55e39e9bef268541bf85424396210a56c6fafa013"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.compensatePublished (cognitive 113): Store.compensatePublished has cognitive complexity 113 (threshold 15). Drivers by points: if/else 103, boolean chains 9, loops 1 (nesting depth added 68). To reduce it, split the body into named stages: move each independent 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":"internal/checkpoint/transaction.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b64bc57c630d0e21dc1519e4141b537c85db48c3fa85aa52439f1732cd3555b"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runMacUpdateHandoff (cognitive 112): main.runMacUpdateHandoff has cognitive complexity 112 (threshold 15). Drivers by points: if/else 108, boolean chains 4 (nesting depth added 39). Of this number, 69 points are the body\u0027s own statements and 43 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/updater_mac.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"f55d69e5838334380fc4f79031f88295821a0e6a5b008165fde59aca36df5022"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.selectMany (cognitive 107): cli.selectMany has cognitive complexity 107 (threshold 15). Drivers by points: if/else 76, loops 15, boolean chains 11, match/switch 5 (nesting depth added 55). Of this number, 87 points are the body\u0027s own statements and 20 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":"internal/cli/select.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"9887a8e4ee75c66818adeb22e4b6ebc3c7a979cc64dcdc165dc0081421a111a0"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.UndoLastRepair (cognitive 107): repair.UndoLastRepair has cognitive complexity 107 (threshold 15). Drivers by points: if/else 99, boolean chains 6, loops 2 (nesting depth added 56). Of this number, 74 points are the body\u0027s own statements and 33 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":"internal/repair/transaction.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"e308957f90f8abdf8875b09f96ddca8668c3fc802424420e17ca046eb03ec380"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.migrateLegacySessionsWithMarkers (cognitive 102): agent.migrateLegacySessionsWithMarkers has cognitive complexity 102 (threshold 15). Drivers by points: if/else 82, boolean chains 13, loops 7 (nesting depth added 49). To reduce it, split the body into named stages: move each independent 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":"internal/agent/migrate.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1fba8697483b8b3cb5f8837d0a15d233b73495abb1bd56cda95125661523b46"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.botDoctor (cognitive 93): cli.botDoctor has cognitive complexity 93 (threshold 15). Drivers by points: if/else 83, loops 6, boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/bot.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"297b973df9a993455625394266e0574331359c50ba28ad4d10bc6c55bfa48a5d"}},{"ruleId":"D2","level":"warning","message":{"text":"client.buildRequest (cognitive 88): client.buildRequest has cognitive complexity 88 (threshold 15). Drivers by points: if/else 68, loops 9, match/switch 7, boolean chains 4 (nesting depth added 47). Of this number, 85 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":"internal/provider/anthropic/anthropic.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"081e32c7de6a2f5fe383881e1c79f98cb027d63861555ed4d861c35d77e566bd"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.runAgent (cognitive 86): cli.runAgent has cognitive complexity 86 (threshold 15). Drivers by points: if/else 79, boolean chains 7 (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":"internal/cli/cli.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ba3181fe1f02b0a580b02f848c0dc6d770d9bb0b8d889f86ae89c806c8907b8"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.validateUpdateTransactionForLauncher (cognitive 83): repair.validateUpdateTransactionForLauncher has cognitive complexity 83 (threshold 15). Drivers by points: if/else 68, boolean chains 10, loops 4, match/switch 1 (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":"internal/repair/update.go"},"region":{"startLine":3115}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa33e31b33c8f809b47127178ba8d4b132d80533178f63871aba3ff6c6c88c96"}},{"ruleId":"D2","level":"warning","message":{"text":"main.historyMessagesWithPlannerDisplaysAndLookups (cognitive 82): main.historyMessagesWithPlannerDisplaysAndLookups has cognitive complexity 82 (threshold 15). Drivers by points: if/else 64, boolean chains 12, loops 6 (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":"desktop/app.go"},"region":{"startLine":5861}}}],"partialFingerprints":{"codehealthFindingId/v1":"7059ae3a0a373de323d60f375e1f400b9595b51f9c9d68c57de4963ecc4bf003"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.planClaudeMarketplace (cognitive 82): installSourceTool.planClaudeMarketplace has cognitive complexity 82 (threshold 15). Drivers by points: if/else 79, boolean chains 2, loops 1 (nesting depth added 43). Of this number, 81 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":"internal/installsource/plugin_package.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc32908091ee2dea68ece8b536a838001a56461c234a945dae1a8aaabca74b1d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.sanitizeRemoteMarkdownSVG (cognitive 81): main.sanitizeRemoteMarkdownSVG has cognitive complexity 81 (threshold 15). Drivers by points: if/else 67, boolean chains 8, loops 4, match/switch 2 (nesting depth added 47). To reduce it, split the body into named stages: move each independent 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":"desktop/remote_markdown_image.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"309ddc63c1443bdbd3efa4a323e316c4ca980e238b76cf69df5879a61aee2cb9"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.stream (cognitive 81): Agent.stream has cognitive complexity 81 (threshold 15). Drivers by points: if/else 64, boolean chains 11, match/switch 4, loops 2 (nesting depth added 42). Of this number, 73 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":"internal/agent/agent.go"},"region":{"startLine":2880}}}],"partialFingerprints":{"codehealthFindingId/v1":"a85d1d27fcd9bcf3daf274b07a93bd5ce752551b013e922957de29727ec869d3"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.executeBatch (cognitive 81): Agent.executeBatch has cognitive complexity 81 (threshold 15). Drivers by points: if/else 55, loops 14, boolean chains 12 (nesting depth added 32). Of this number, 58 points are the body\u0027s own statements and 23 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":3213}}}],"partialFingerprints":{"codehealthFindingId/v1":"de9f774963794d05f9528666cca8dec7db0e6d1e654c3a284ac7b01abeb14f3e"}},{"ruleId":"D2","level":"warning","message":{"text":"App.rebindTabToLoadedSessionPath (cognitive 80): App.rebindTabToLoadedSessionPath has cognitive complexity 80 (threshold 15). Drivers by points: if/else 72, boolean chains 8 (nesting depth added 26). Of this number, 77 points are the body\u0027s own statements and 3 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":"desktop/app.go"},"region":{"startLine":4155}}}],"partialFingerprints":{"codehealthFindingId/v1":"28ba46ceff62f3b60f23cb7314d77e022bd0a658200ddb081bf4685d993f867f"}},{"ruleId":"D2","level":"warning","message":{"text":"Session.save (cognitive 80): Session.save has cognitive complexity 80 (threshold 15). Drivers by points: if/else 72, match/switch 5, boolean chains 3 (nesting depth added 40). To reduce it, split the body into named stages: move each independent 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":"internal/agent/save.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f55d24aa3af8d481bc4cdb4ee9acea5ae97ff21d510c5c18818cedcaaccae57"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.prepareTransaction (cognitive 79): Store.prepareTransaction has cognitive complexity 79 (threshold 15). Drivers by points: if/else 68, boolean chains 7, loops 4 (nesting depth added 45). Of this number, 78 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":"internal/checkpoint/transaction.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"c55c3b5ecca163f36f02d48bcad9f0e49f1de3e280abe2f6508afc83d49df3a1"}},{"ruleId":"D2","level":"warning","message":{"text":"TaskTool.RunProfileSpec (cognitive 78): TaskTool.RunProfileSpec has cognitive complexity 78 (threshold 15). Drivers by points: if/else 67, boolean chains 11 (nesting depth added 25). Of this number, 61 points are the body\u0027s own statements and 17 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":"internal/agent/task.go"},"region":{"startLine":809}}}],"partialFingerprints":{"codehealthFindingId/v1":"63855c04506fa525fa7514c6d410454e62e4d2b66603fd9a0a7fb46ab9143ec3"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.ingestEvent (cognitive 78): chatTUI.ingestEvent has cognitive complexity 78 (threshold 15). Drivers by points: if/else 61, loops 8, boolean chains 6, match/switch 3 (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":"internal/cli/chat_tui.go"},"region":{"startLine":4250}}}],"partialFingerprints":{"codehealthFindingId/v1":"8162333e9ebb11280483b112cf56b2884c3b0fa6d10428c7b654636c4d565ab0"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.submitCommandOrTurn (cognitive 76): Controller.submitCommandOrTurn has cognitive complexity 76 (threshold 15). Drivers by points: if/else 72, match/switch 3, boolean chains 1 (nesting depth added 41). Of this number, 57 points are the body\u0027s own statements and 19 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/controller.go"},"region":{"startLine":1367}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a2100175ecfc0cb48244cc96074832537a9de9ccad00698e86bbecbc7743c5d"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.inspectAndRepairConfigUnlocked (cognitive 75): repair.inspectAndRepairConfigUnlocked has cognitive complexity 75 (threshold 15). Drivers by points: if/else 68, boolean chains 6, 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":"internal/repair/config.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"df9aa7d9c8a6bd4e4e2a91047c15350b82d24d17195833bc77758bbc93a4286f"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.chatREPL (cognitive 74): cli.chatREPL has cognitive complexity 74 (threshold 15). Drivers by points: if/else 63, boolean chains 4, match/switch 4, loops 3 (nesting depth added 18). Of this number, 65 points are the body\u0027s own statements and 9 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":"internal/cli/cli.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"62e2b42310c3527f7712e2dbada599d82587bba3652cec2fa2fa7239429eca92"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.validateValue (cognitive 74): protocol.validateValue has cognitive complexity 74 (threshold 15). Drivers by points: if/else 66, loops 4, boolean chains 3, match/switch 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent 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":"internal/extension/protocol/validate.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f3824e7301b89e9e7c2c94f995497b2cb43febfd2ebc8e2bf3075b3aade45ca"}},{"ruleId":"D2","level":"warning","message":{"text":"ControlService.controlOp (cognitive 74): ControlService.controlOp has cognitive complexity 74 (threshold 15). Drivers by points: if/else 60, boolean chains 13, loops 1 (nesting depth added 24). Of this number, 72 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":"internal/taskmonitor/control.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"c252cdc7b78465690b371fbfeda6ff544913b0bf138a690cffa7f48d22146f84"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.readOnlyExecutionBlock (cognitive 73): Agent.readOnlyExecutionBlock has cognitive complexity 73 (threshold 15). Drivers by points: if/else 60, boolean chains 12, match/switch 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":3864}}}],"partialFingerprints":{"codehealthFindingId/v1":"32621d601362e10507f3aa9ea0a861e50db8a5cb18feac369270afcec32cbe99"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.ssrfGuardedTransport (cognitive 71): builtin.ssrfGuardedTransport has cognitive complexity 71 (threshold 15). Drivers by points: if/else 65, match/switch 3, boolean chains 2, loops 1 (nesting depth added 49). Of this number, 20 points are the body\u0027s own statements and 51 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":"internal/tool/builtin/webfetch.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"587caa1c8cf27c4a4aa5859249e0f634961920bd958f296ba6e95ea7d2c3c847"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.restoreConfigSnapshotBoundUnlocked (cognitive 70): repair.restoreConfigSnapshotBoundUnlocked has cognitive complexity 70 (threshold 15). Drivers by points: if/else 69, loops 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":"internal/repair/snapshot.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5e9ade4da3c113f678fc022cd9d82cfcb8a0b7662ffff7115b9958eba4fef6d"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.finalReadinessCheckFor (cognitive 68): Agent.finalReadinessCheckFor has cognitive complexity 68 (threshold 15). Drivers by points: if/else 50, boolean chains 17, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":1615}}}],"partialFingerprints":{"codehealthFindingId/v1":"139edc1da5afb93216560f9dddcb13c225a373aab1adfd4f10beacf33633459a"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.SaveWithOptions (cognitive 68): Store.SaveWithOptions has cognitive complexity 68 (threshold 15). Drivers by points: if/else 57, boolean chains 9, loops 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":"internal/memory/store_v2.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"daf3bee279f927fab68e163eecb8bd761f17558a77bf22de63bba006b22859d8"}},{"ruleId":"D2","level":"warning","message":{"text":"main.repairIndexedSessionTopics (cognitive 67): main.repairIndexedSessionTopics has cognitive complexity 67 (threshold 15). Drivers by points: if/else 56, loops 8, boolean chains 3 (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":"desktop/tabs.go"},"region":{"startLine":6645}}}],"partialFingerprints":{"codehealthFindingId/v1":"50c570e764f51fc8fef99e45bb1bddc59eafc9f962284011f20c9d1a7f170999"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.claudeFacingToolInput (cognitive 66): hook.claudeFacingToolInput has cognitive complexity 66 (threshold 15). Drivers by points: if/else 53, boolean chains 8, loops 5 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/hook/hook.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"b75fce06f2d361d6e24ea2dfbf99ab436f21c054eaa9cc3437d6e4825ede107d"}},{"ruleId":"D2","level":"warning","message":{"text":"providerSetupSession.replayOperations (cognitive 65): providerSetupSession.replayOperations has cognitive complexity 65 (threshold 15). Drivers by points: if/else 52, loops 9, boolean chains 2, 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":"internal/cli/setup_manager.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bbc5be66bf57cb978eecc04040129ca949aba0c9aaa778768180e65c1b15f02"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ListProjectTree (cognitive 64): App.ListProjectTree has cognitive complexity 64 (threshold 15). Drivers by points: if/else 41, loops 15, boolean chains 5, match/switch 3 (nesting depth added 25). Of this number, 45 points are the body\u0027s own statements and 19 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":7715}}}],"partialFingerprints":{"codehealthFindingId/v1":"479d541c3f3091eaf0b1c58bee8b08e9191e8571087fb39d3055908442e25f57"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.migrateSubDirectory (cognitive 64): agent.migrateSubDirectory has cognitive complexity 64 (threshold 15). Drivers by points: if/else 54, boolean chains 6, loops 2, match/switch 2 (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":"internal/agent/migrate.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a873ea8059cf73b76b0a18bc1d794107ea512e60aa75f9615403f03fdea7d1c"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.recoverTransactions (cognitive 64): Store.recoverTransactions has cognitive complexity 64 (threshold 15). Drivers by points: if/else 45, boolean chains 9, loops 8, match/switch 2 (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":"internal/checkpoint/transaction.go"},"region":{"startLine":1194}}}],"partialFingerprints":{"codehealthFindingId/v1":"8edc6ca04df72a2d66588d071635103b5b3edee439aec7e9330bb9a2818e4314"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleMCPManagerKey (cognitive 64): chatTUI.handleMCPManagerKey has cognitive complexity 64 (threshold 15). Drivers by points: if/else 50, match/switch 14 (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":"internal/cli/mcp_manager.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4b2fdd5e58669ec0f64725112cf8361a76789cb495db2a1dab5536ff4d21443"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.appendClaudeHooksFile (cognitive 64): pluginpkg.appendClaudeHooksFile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 52, loops 7, boolean chains 5 (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":"internal/pluginpkg/claude_compat.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc25daba352f8fe084e454928c631f8a426099bee3f5618c933ddf2dc1721659"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.selectOne (cognitive 61): cli.selectOne has cognitive complexity 61 (threshold 15). Drivers by points: if/else 39, boolean chains 9, loops 8, match/switch 5 (nesting depth added 23). Of this number, 43 points are the body\u0027s own statements and 18 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":"internal/cli/select.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c399d55d5b91b96bb8a498f91e362dd15f0fd98ac1df5188489942ea055aec9"}},{"ruleId":"D2","level":"warning","message":{"text":"UseCapabilityTool.inspect (cognitive 60): UseCapabilityTool.inspect has cognitive complexity 60 (threshold 15). Drivers by points: if/else 50, loops 6, boolean chains 4 (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":"internal/agent/usecapability.go"},"region":{"startLine":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b743f11502a7782ee0c4b20fd7a117cb5ca6389e11b1a9320f0877c3529f92b"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.parseMCPAdd (cognitive 59): cli.parseMCPAdd has cognitive complexity 59 (threshold 15). Drivers by points: if/else 46, boolean chains 9, match/switch 3, loops 1 (nesting depth added 26). Of this number, 55 points are the body\u0027s own statements and 4 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":"internal/cli/mcp.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e155c182fb32844a6bda877470abe6c1630cba6d83e2fa04708817d4db5af78"}},{"ruleId":"D2","level":"warning","message":{"text":"openai.New (cognitive 59): openai.New has cognitive complexity 59 (threshold 15). Drivers by points: if/else 29, match/switch 16, boolean chains 14 (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":"internal/provider/openai/openai.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"d94b536f3625df8136bc475cfe6f89c02dc04931effc10d689e33ccf5d3b03a1"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.collectSymbols (cognitive 58): builtin.collectSymbols has cognitive complexity 58 (threshold 15). Drivers by points: if/else 37, loops 14, match/switch 6, boolean chains 1 (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":"internal/tool/builtin/delete_symbol.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f3b805ba9950602d131d9fe2f69dca06530ed829a7e2578698b0671acb19edd"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.runServe (cognitive 57): cli.runServe has cognitive complexity 57 (threshold 15). Drivers by points: if/else 54, boolean chains 3 (nesting depth added 15). Of this number, 54 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":"internal/cli/cli.go"},"region":{"startLine":799}}}],"partialFingerprints":{"codehealthFindingId/v1":"30d66118b6397427c6fbe9540ae1fd054d3d5e095ac4fa6980c45f4796aa4816"}},{"ruleId":"D2","level":"warning","message":{"text":"Session.saveRecoveryBranch (cognitive 56): Session.saveRecoveryBranch has cognitive complexity 56 (threshold 15). Drivers by points: if/else 47, boolean chains 9 (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":"internal/agent/save.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"c135e4e624539c600acc06c2999b878054d88111c56c9468e6965ac847e7b22a"}},{"ruleId":"D2","level":"warning","message":{"text":"SubagentStore.CleanupStaleRunning (cognitive 56): SubagentStore.CleanupStaleRunning has cognitive complexity 56 (threshold 15). Drivers by points: if/else 48, loops 5, boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/subagent_store.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"5df3ba24bfc2356dd76ebe9cf5e8aa27e6b73d1587b1002489ee3dbed6359deb"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.validateManifest (cognitive 56): pluginpkg.validateManifest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 43, loops 9, boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/pluginpkg/pluginpkg.go"},"region":{"startLine":785}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db987aa61876c11df07d110e69713e115c94e06ba6164685783b8f801f9a321"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.applyPlanModeAndProxy (cognitive 55): Agent.applyPlanModeAndProxy has cognitive complexity 55 (threshold 15). Drivers by points: if/else 49, boolean chains 6 (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":"internal/agent/execute_one.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"914725ec600b5e444ede396242931ebc582281015ed99659a079b3149fc956b9"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.managementNotice (cognitive 54): Controller.managementNotice has cognitive complexity 54 (threshold 15). Drivers by points: if/else 43, match/switch 5, boolean chains 3, loops 3 (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":"internal/control/slash.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0da5cc9ca729bdc9d3406131461e7d3596cfdae6e41ad56a92dc0d46dbf5ab8"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.appendInventoryText (cognitive 54): pluginpkg.appendInventoryText has cognitive complexity 54 (threshold 15). Drivers by points: if/else 41, loops 12, 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":"internal/pluginpkg/describe.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"95a21fad5c6a29ec69dcfea0d4fe4817cc9dcda6e0e3bb51bf998a54dfad8132"}},{"ruleId":"D2","level":"warning","message":{"text":"client.buildRequest (cognitive 54): client.buildRequest has cognitive complexity 54 (threshold 15). Drivers by points: if/else 35, boolean chains 9, match/switch 6, loops 4 (nesting depth added 21). Of this number, 53 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":"internal/provider/openai/openai.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb1b6270d4150f0b8196526f8c3b259a822ab575b75a755bb04b58d565a9cf0b"}},{"ruleId":"D2","level":"warning","message":{"text":"main.migrateLegacySessionsIntoGlobalTopics (cognitive 52): main.migrateLegacySessionsIntoGlobalTopics has cognitive complexity 52 (threshold 15). Drivers by points: if/else 50, boolean chains 1, loops 1 (nesting depth added 20). 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":"desktop/tabs.go"},"region":{"startLine":6480}}}],"partialFingerprints":{"codehealthFindingId/v1":"d16680257269a1baaa765a7121f1124bfb9ed61449d24140a1472b9840a06fde"}},{"ruleId":"D2","level":"warning","message":{"text":"App.removeBuiltInProviderAccessAndRetargetTabs (cognitive 52): App.removeBuiltInProviderAccessAndRetargetTabs has cognitive complexity 52 (threshold 15). Drivers by points: if/else 44, loops 7, boolean chains 1 (nesting depth added 22). Of this number, 51 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":"desktop/settings_app.go"},"region":{"startLine":2859}}}],"partialFingerprints":{"codehealthFindingId/v1":"506ade1a2e373cb5123a87b9167d0485a661c03aa03711635ab06055e4e1a303"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.observeMissingToolCallReasoning (cognitive 52): Agent.observeMissingToolCallReasoning has cognitive complexity 52 (threshold 15). Drivers by points: if/else 48, boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":1388}}}],"partialFingerprints":{"codehealthFindingId/v1":"18cca51650643981d4ffeb6c8c4ab23a8187f927cefffc10d1acb1c0a2eb79dd"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.CommitFileRevert (cognitive 52): Store.CommitFileRevert has cognitive complexity 52 (threshold 15). Drivers by points: if/else 44, boolean chains 6, loops 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1620}}}],"partialFingerprints":{"codehealthFindingId/v1":"95a7d8f074904eac071775da2cd320fb636a141bf92cbcbcd02a7a5534631534"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.printPluginInventory (cognitive 52): cli.printPluginInventory has cognitive complexity 52 (threshold 15). Drivers by points: if/else 40, loops 12 (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":"internal/cli/plugin.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"c28fdc90701051ca2cf44868e22340326e7304cc2f50f83ebeab175ca8b435e7"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.CollectSkillHealthWarnings (cognitive 52): doctor.CollectSkillHealthWarnings has cognitive complexity 52 (threshold 15). Drivers by points: if/else 32, loops 17, boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/doctor/skill_health.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c6651f0074ea50c0e32d3aa5b8bcfda4a847e1f68d54b701bd83427c72813a8"}},{"ruleId":"D2","level":"warning","message":{"text":"secrets.redactKeyValues (cognitive 52): secrets.redactKeyValues has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23, boolean chains 15, loops 14 (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":"internal/secrets/redact.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"5398c8b36abc90d3d6f4ed9ed637e99b5344ad17cdc8d80ec5315da040c64d71"}},{"ruleId":"D2","level":"warning","message":{"text":"App.mcpServersView (cognitive 51): App.mcpServersView has cognitive complexity 51 (threshold 15). Drivers by points: if/else 37, loops 14 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":8142}}}],"partialFingerprints":{"codehealthFindingId/v1":"d033d87514df6214d555867100ae358245b3dfe05a0ce4bb3fa2d100c83f6c0f"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.runSlashCommand (cognitive 51): chatTUI.runSlashCommand has cognitive complexity 51 (threshold 15). Drivers by points: if/else 46, loops 3, boolean chains 1, match/switch 1 (nesting depth added 24). Of this number, 49 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":"internal/cli/chat_tui.go"},"region":{"startLine":4528}}}],"partialFingerprints":{"codehealthFindingId/v1":"419fbc544559f8290b198d29d64b98eef0e3661c11ec8cbd91da00a5235dd5f3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.deleteProviderAndRetargetTabs (cognitive 50): App.deleteProviderAndRetargetTabs has cognitive complexity 50 (threshold 15). Drivers by points: if/else 42, loops 6, boolean chains 2 (nesting depth added 17). Of this number, 48 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":"desktop/settings_app.go"},"region":{"startLine":2992}}}],"partialFingerprints":{"codehealthFindingId/v1":"af39e97f525d14e963aa97ac77fce9d0b536cc281e557995aeaf6238941fce71"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.parseSimpleHookCommandFields (cognitive 50): hook.parseSimpleHookCommandFields has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, loops 7, boolean chains 4 (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":"internal/hook/command_normalize.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"67fa1489944e5eb1dc6d6559eb1a1597cfd9e618921a5a499038161e61af51c6"}},{"ruleId":"D2","level":"warning","message":{"text":"responses.messagesToInput (cognitive 50): responses.messagesToInput has cognitive complexity 50 (threshold 15). Drivers by points: if/else 34, loops 12, boolean chains 2, match/switch 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent 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":"internal/provider/responses/responses.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"52bd5cf8965d20950859a63f9e366b4d30dd9d3d51ec328b92a311e1afa6b1e2"}},{"ruleId":"D2","level":"warning","message":{"text":"App.RemoveWorkspace (cognitive 49): App.RemoveWorkspace has cognitive complexity 49 (threshold 15). Drivers by points: if/else 32, loops 11, boolean chains 6 (nesting depth added 12). Most of this is not in the body itself: 8 of the 49 points are its own statements and the rest belongs to one function literal inside it that branches (line 5292). 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":"desktop/app.go"},"region":{"startLine":5278}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bdecb6c1a8d32bcd18980134e2efdd04c7e308279dd8f2e840a9a336f8d69db"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SaveThemePack (cognitive 49): App.SaveThemePack has cognitive complexity 49 (threshold 15). Drivers by points: if/else 43, boolean chains 6 (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":"desktop/theme_app.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1f1ab37977a355e49c713a8ff772be27f0e224f46d0af85b333b0b7002ac4f3"}},{"ruleId":"D2","level":"warning","message":{"text":"installlayout.ActivateVersion (cognitive 49): installlayout.ActivateVersion has cognitive complexity 49 (threshold 15). Drivers by points: if/else 44, loops 4, boolean chains 1 (nesting depth added 13). Of this number, 44 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":"internal/installlayout/activate.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"04e4c5b53693cbb31922b0e0a6df5ddcdbd710061c75439927410c3064ed6305"}},{"ruleId":"D2","level":"warning","message":{"text":"FleetTool.Execute (cognitive 48): FleetTool.Execute has cognitive complexity 48 (threshold 15). Drivers by points: if/else 38, loops 6, boolean chains 4 (nesting depth added 21). Of this number, 44 points are the body\u0027s own statements and 4 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":"internal/agent/fleet.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fc82237af77042a94102877f013b454f01a36e2d5c6d857cb8f7e0ac54df3da"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.commitTransaction (cognitive 48): Store.commitTransaction has cognitive complexity 48 (threshold 15). Drivers by points: if/else 39, boolean chains 8, 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":"internal/checkpoint/transaction.go"},"region":{"startLine":665}}}],"partialFingerprints":{"codehealthFindingId/v1":"2818de4b4412647cfec467ad86adffde02c497ace488e8c88615a3b79fd6f1ab"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.PublishClaimedFileUpdateMemberExact (cognitive 48): repair.PublishClaimedFileUpdateMemberExact has cognitive complexity 48 (threshold 15). Drivers by points: if/else 44, boolean chains 3, loops 1 (nesting depth added 17). Of this number, 47 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":"internal/repair/update.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a1811261d5148bd338098c53b0226ff8e6bb2b7ac906b481d1a913bee94af56"}},{"ruleId":"D2","level":"warning","message":{"text":"main.recordHistoryDisplayEvent (cognitive 46): main.recordHistoryDisplayEvent has cognitive complexity 46 (threshold 15). Drivers by points: if/else 39, boolean chains 3, loops 3, match/switch 1 (nesting depth added 25). 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":"desktop/tabs.go"},"region":{"startLine":1250}}}],"partialFingerprints":{"codehealthFindingId/v1":"24d49c98b4d133de81b17a9b254a03aeb7657ed5aafd9c4d899f42211f1d4c73"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.deliveryReviewGateFailure (cognitive 45): Agent.deliveryReviewGateFailure has cognitive complexity 45 (threshold 15). Drivers by points: if/else 37, boolean chains 7, match/switch 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":"internal/agent/capability_gate.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dd284f000801eb597adbfc263bc23dbb678fe17881698e6e1caf7ce865f02dd"}},{"ruleId":"D2","level":"warning","message":{"text":"config.scanTOMLLine (cognitive 45): config.scanTOMLLine has cognitive complexity 45 (threshold 15). Drivers by points: if/else 29, match/switch 13, boolean chains 2, loops 1 (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":"internal/config/edit.go"},"region":{"startLine":1958}}}],"partialFingerprints":{"codehealthFindingId/v1":"39cd360dd15535b93a7e692909b31724ef536185e8800429c767f6df15cabbe5"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.snapshot (cognitive 45): Controller.snapshot has cognitive complexity 45 (threshold 15). Drivers by points: if/else 42, boolean chains 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":"internal/control/controller.go"},"region":{"startLine":3965}}}],"partialFingerprints":{"codehealthFindingId/v1":"61c20ed84e41f20eb98aa62e8b08cbcb54480fd8907a282c8cd417599898d118"}},{"ruleId":"D2","level":"warning","message":{"text":"Dispatcher.Intercept (cognitive 45): Dispatcher.Intercept has cognitive complexity 45 (threshold 15). Drivers by points: if/else 41, match/switch 2, boolean chains 1, loops 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":"internal/extension/dispatch/dispatch.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"de12a968a195138a40359c138afc5c0c6317096d5d758b7ab89d6bc64eacecbc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.bracePairsByLine (cognitive 45): builtin.bracePairsByLine has cognitive complexity 45 (threshold 15). Drivers by points: if/else 31, match/switch 7, loops 4, boolean chains 3 (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":"internal/tool/builtin/delete_range.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"564185a54cc3340aca3774b403884adce896ed2ab5de04749120e89d25e9ef0c"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SetModelForTab (cognitive 44): App.SetModelForTab has cognitive complexity 44 (threshold 15). Drivers by points: if/else 40, boolean chains 4 (nesting depth added 8). Of this number, 41 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, 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":"desktop/app.go"},"region":{"startLine":9950}}}],"partialFingerprints":{"codehealthFindingId/v1":"af513d8a29883047e5843868d5334cf77ae250ba41564ede6cc427009a96fffb"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.View (cognitive 44): chatTUI.View has cognitive complexity 44 (threshold 15). Drivers by points: if/else 42, match/switch 2 (nesting depth added 11). 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":"internal/cli/chat_tui.go"},"region":{"startLine":3310}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbd5933cc9cf8be309e2a503a289d21b1e223554e856fddb105dda023331774f"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.stripCancelledVisibleTurnMessagesAfterWithFallbackAt (cognitive 44): Controller.stripCancelledVisibleTurnMessagesAfterWithFallbackAt has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25, loops 11, boolean chains 6, match/switch 2 (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":"internal/control/controller.go"},"region":{"startLine":4517}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8e6bc58dac7f16af2a14e997ac5ff2b66bc83eed84a4400933b59d3c935dd84"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.beginRunTurn (cognitive 43): Agent.beginRunTurn has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23, boolean chains 12, loops 6, match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/run_loop.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"19de9869db1202d5334364652f8a3cae9a324aede611cfcf4ee4465d5075f65a"}},{"ruleId":"D2","level":"warning","message":{"text":"Session.checkSnapshotWrite (cognitive 43): Session.checkSnapshotWrite has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, boolean chains 14 (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":"internal/agent/save.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2494b4d169cb067e9330905b4acc1e37ff6b86b61053cae921c608d7a6ce9f7"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.ValidateSerialTodos (cognitive 43): evidence.ValidateSerialTodos has cognitive complexity 43 (threshold 15). Drivers by points: if/else 26, loops 10, match/switch 4, boolean chains 3 (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":"internal/evidence/evidence.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc7bb9794604b9c6b5fd8c741f4a01cfd0bb123f87067f0a7f507420f27c3187"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.rebuildDerivedStateBoundUnlocked (cognitive 43): repair.rebuildDerivedStateBoundUnlocked has cognitive complexity 43 (threshold 15). Drivers by points: if/else 40, 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":"internal/repair/derived.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ca9b078ed83267770a6e3d9906ce86c57c1069f267e398ebfeadad118ded2a2"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.applyRecoveryAndPermission (cognitive 42): Agent.applyRecoveryAndPermission has cognitive complexity 42 (threshold 15). Drivers by points: if/else 34, boolean chains 8 (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":"internal/agent/execute_one.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"c76a09d35fa163752aa72e21f6d7195d02de1b3775d562c106d50e28cb085eb5"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.parseCopyTranscript (cognitive 42): cli.parseCopyTranscript has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, boolean chains 4, loops 3, 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":"internal/cli/transcript.go"},"region":{"startLine":534}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ac65cfacb60408b3fd86ce2b62d9580b8a0d2fd2e39c2a594600257e21cadfa"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.routeCapabilities (cognitive 42): Controller.routeCapabilities has cognitive complexity 42 (threshold 15). Drivers by points: if/else 34, loops 6, 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":"internal/control/capability.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7c70a2785b6db9ea36c391aa8a651eb012efc3e27139b0a8000507abc25df46"}},{"ruleId":"D2","level":"warning","message":{"text":"turnOrchestrator.runOrchestratedTurn (cognitive 42): turnOrchestrator.runOrchestratedTurn has cognitive complexity 42 (threshold 15). Drivers by points: if/else 36, boolean chains 6 (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":"internal/control/turn_orchestrator.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d3389676c1e7743ad76d9d4f7dd859f7703f1bbc67ecc95bf30a40887e7a3e6"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.bashSegmentIsVerification (cognitive 42): evidence.bashSegmentIsVerification has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23, boolean chains 8, loops 7, match/switch 4 (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":"internal/evidence/evidence.go"},"region":{"startLine":1904}}}],"partialFingerprints":{"codehealthFindingId/v1":"78bc054d051e56dadc570a43261109918ac3bc3b618d7d1e67899525f91ec837"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.ClassifyMutationRisk (cognitive 42): evidence.ClassifyMutationRisk has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31, loops 7, boolean chains 4 (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":"internal/evidence/risk.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8becaf01d7a14cbfde9777be74a5a350ce68a269682d38bdd8f48af9dbd63e8"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.validateV1Paths (cognitive 42): pluginpkg.validateV1Paths has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, loops 7 (nesting depth added 18). Of this number, 36 points are the body\u0027s own statements and 6 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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"68b2e476ab29131c319a7a32b35a94c94ceece5b62f5ae73f5b269111530e2ae"}},{"ruleId":"D2","level":"warning","message":{"text":"remote.discoverSSHAliases (cognitive 42): remote.discoverSSHAliases has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27, loops 11, boolean chains 2, match/switch 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":"internal/remote/sshconfig.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"598990cf1d6f22e1369b849827ab384b31fe12fe2dc8248131372df6ac3747f3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.WorkspaceChanges (cognitive 41): App.WorkspaceChanges has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, loops 7, boolean chains 2 (nesting depth added 20). Of this number, 38 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/workspace_changes.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"743a6f54354ea1f4d423e7383e5d487b613caa01c2a178d93efbf6ff2a3af53d"}},{"ruleId":"D2","level":"warning","message":{"text":"UseCapabilityTool.resolveCall (cognitive 41): UseCapabilityTool.resolveCall has cognitive complexity 41 (threshold 15). Drivers by points: if/else 38, boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/usecapability.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"9616c482c88722caee67c599b859695282a7272fd1f4423453b2cee552ea9133"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.probeLiveMCP (cognitive 41): capdiag.probeLiveMCP has cognitive complexity 41 (threshold 15). Drivers by points: if/else 30, loops 10, 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":"internal/capdiag/live.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"9329d5f54e01c5f9238fe711573ccf198b4689cf0b93a64a8456a77192e31915"}},{"ruleId":"D2","level":"warning","message":{"text":"guardian.renderTranscript (cognitive 41): guardian.renderTranscript has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29, boolean chains 6, loops 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":"internal/guardian/transcript.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"c44f22c90c956d3518245f6affafa5aeeaa311cc2d022c9369e207035e4b1768"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.appendPluginHooks (cognitive 41): hook.appendPluginHooks has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29, loops 12 (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":"internal/hook/hook.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"eece5b4e3797e1a0d53cb3d9fb7617c6d336c403c05614cc6a371402a733b89a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.previewEventSessionMessages (cognitive 40): main.previewEventSessionMessages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, loops 4, match/switch 2, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":6509}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b1ab09c32acf289f8bd5fd8b3769b54451e89757237b835b30f23959e8b27e3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.attachExistingSessionRuntime (cognitive 40): App.attachExistingSessionRuntime has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31, boolean chains 8, loops 1 (nesting depth added 9). Of this number, 37 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":"desktop/tabs.go"},"region":{"startLine":804}}}],"partialFingerprints":{"codehealthFindingId/v1":"81027c316a1341e61246bca9881213ac92e9cdd2a804f0a3db6bf80cd08c56dc"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.interruptedRecoveryBlock (cognitive 40): agent.interruptedRecoveryBlock has cognitive complexity 40 (threshold 15). Drivers by points: if/else 29, loops 8, boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/interrupted_recovery.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"a02288a23422afeeba773e3fd30d1fa4f262ae02b9422b98d2183de827b125ea"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.inputCursorByteOffset (cognitive 40): chatTUI.inputCursorByteOffset has cognitive complexity 40 (threshold 15). Drivers by points: if/else 34, loops 5, boolean chains 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":"internal/cli/complete.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"407edb8a191ed27bc845156a54b2b1cb6a1d16abd69e691c9645ddec9a2eb26d"}},{"ruleId":"D2","level":"warning","message":{"text":"environment.FormatSection (cognitive 40): environment.FormatSection has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, loops 6, boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/environment/probe.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ea2350e40868bf8a5e78c80eb21baaf8c3c6feafe2e5198be7e833d1d47f375"}},{"ruleId":"D2","level":"warning","message":{"text":"Writer.Query (cognitive 40): Writer.Query has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26, loops 11, boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/stats/query.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c20cfd9d077d64acf7b74a9cd379451898872d53d4b5137897d9b4d4eae2122"}},{"ruleId":"D2","level":"warning","message":{"text":"App.installPortableUpdate (cognitive 39): App.installPortableUpdate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 34, boolean chains 4, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/updater_app.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9a57977c997af2b67dcc82ea9d05f6de1ce8f9372a96c6062c50347fb8c9d6b"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.prepareToolExecution (cognitive 39): Agent.prepareToolExecution has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, boolean chains 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":"internal/agent/execute_one.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"c003df98b0813b18f3219c2e77602b8f53446a998f01fec4466265f07b2bc677"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.handleToolRound (cognitive 39): Agent.handleToolRound has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, loops 6, boolean chains 3, 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":"internal/agent/run_loop.go"},"region":{"startLine":574}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f849748137f4b49fea89709f80669afce1a6a6f7d51c1c152fbb6f515f1b252"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleApprovalKey (cognitive 39): chatTUI.handleApprovalKey has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27, boolean chains 6, loops 4, match/switch 2 (nesting depth added 15). Of this number, 30 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":"internal/cli/chat_tui.go"},"region":{"startLine":3156}}}],"partialFingerprints":{"codehealthFindingId/v1":"ead747fc69635b1bc20cc949f64ded112b9c47848e95c0d0b4469e9ae9ecace2"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.localSkillActions (cognitive 39): installSourceTool.localSkillActions has cognitive complexity 39 (threshold 15). Drivers by points: if/else 31, loops 7, 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":"internal/installsource/plan.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"6425c01a944c2557cd8e8490be05a593534d9a82c2b84d0e423eedd24d8aa667"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.normalizeDraft202012Schema (cognitive 39): provider.normalizeDraft202012Schema has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22, loops 13, boolean chains 4 (nesting depth added 15). Of this number, 37 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":"internal/provider/schema_dialect.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"55fd3350367b7775eb662fc4122ae61da00960c6261426c8695cd2a7a3cf7ae6"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.classify (cognitive 39): Gate.classify has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29, boolean chains 10 (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":"internal/recovery/gate.go"},"region":{"startLine":803}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cd88cb76e824229f8c3d2e04b413070f3cdff01dc41d196cca6587e317c9b6d"}},{"ruleId":"D2","level":"warning","message":{"text":"skill.bindAllowedTools (cognitive 39): skill.bindAllowedTools has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22, loops 15, boolean chains 2 (nesting depth added 23). Of this number, 37 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":"internal/skill/skill.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7f30109573c76bdb8418401018acea86c8d88eef5572dc6978d4a9ad4a3e5fc"}},{"ruleId":"D2","level":"warning","message":{"text":"App.rebuildSettingTurnLocked (cognitive 38): App.rebuildSettingTurnLocked has cognitive complexity 38 (threshold 15). Drivers by points: if/else 36, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/settings_app.go"},"region":{"startLine":1784}}}],"partialFingerprints":{"codehealthFindingId/v1":"27733b4b1ec4c9d95f82d20ec879b3e2e2edfc1cfea4f41b1b6994382897e210"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.transformAndCopyJsonl (cognitive 38): agent.transformAndCopyJsonl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, loops 3, boolean chains 2 (nesting depth added 17). 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, split the body into named stages: move each independent 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":"internal/agent/migrate.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"5409db2c5c139a754003a25c7a506b0fd351826684c48aed5a54ee3684ec946c"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.replaySessionEventLogWithLimits (cognitive 38): agent.replaySessionEventLogWithLimits has cognitive complexity 38 (threshold 15). Drivers by points: if/else 32, loops 4, match/switch 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":"internal/agent/session_events.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"24f587b77b2002d99bdeafd42012098e32599cee0da8b3e9812f14c296a3bd0a"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelTasksTool.Execute (cognitive 38): ParallelTasksTool.Execute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20, loops 7, match/switch 7, boolean chains 3, jumps 1 (nesting depth added 10). Of this number, 24 points are the body\u0027s own statements and 14 belong to 4 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/parallel_tasks.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb0caa7f93620bdd7ca588aa4a02563d461fb18c4817f5c2d0c13216d7675ff7"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.taskEventsCmd (cognitive 38): cli.taskEventsCmd has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, loops 6, boolean chains 2, match/switch 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":"internal/cli/task.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad1deafc268c5b60ef7e09a2a386870d33df76e74b7faf784bc682f48bdd6d7f"}},{"ruleId":"D2","level":"warning","message":{"text":"grepTool.runNative (cognitive 38): grepTool.runNative has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 2, loops 1 (nesting depth added 14). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 168, 241). 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":"internal/tool/builtin/grep.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"743d7a840d9ec28ff12ce1d1ff19fb34f88a7ed321f838f7a0fa153a6120260d"}},{"ruleId":"D2","level":"warning","message":{"text":"readFile.Execute (cognitive 38): readFile.Execute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/readfile.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6a216d9651ed01460a8386847172cbc9f4cf66aae18e49e6e9e3331a0e5bf25"}},{"ruleId":"D2","level":"warning","message":{"text":"HeartbeatEngine.executeTask (cognitive 37): HeartbeatEngine.executeTask has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/heartbeat.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"47a338c1084ac760c6e076ca3cfc56bb9343fecd11914d6933ba2d7de9833636"}},{"ruleId":"D2","level":"warning","message":{"text":"acp.availableCommandsFor (cognitive 37): acp.availableCommandsFor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, loops 6 (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":"internal/acp/service.go"},"region":{"startLine":2454}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7d4f298d22fa9e61e8e7ea61777b9e3168575aeeeb806763204ee4be2511d68"}},{"ruleId":"D2","level":"warning","message":{"text":"UseCapabilityTool.ResolveCall (cognitive 37): UseCapabilityTool.ResolveCall has cognitive complexity 37 (threshold 15). Drivers by points: if/else 35, boolean chains 1, match/switch 1 (nesting depth added 19). Of this number, 30 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":"internal/agent/usecapability.go"},"region":{"startLine":556}}}],"partialFingerprints":{"codehealthFindingId/v1":"dde4a71a3586db74910c540107b92e1fdbc0a9c1d926adc177071a691f6e5386"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.PrepareRewind (cognitive 37): Store.PrepareRewind has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, boolean chains 6, loops 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":"internal/checkpoint/transaction.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a50a0832c31887eb77bff0caf12a0d9cdcd5d810e00db2e8bc71dec1a6fc0e0"}},{"ruleId":"D2","level":"warning","message":{"text":"config.replaceTOMLSection (cognitive 37): config.replaceTOMLSection has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, loops 6, boolean chains 4 (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":"internal/config/edit.go"},"region":{"startLine":1832}}}],"partialFingerprints":{"codehealthFindingId/v1":"af6e88122436c6a904134caeb7db1f437d390a48641ffbcd1b6fc4d8f8eb0432"}},{"ruleId":"D2","level":"warning","message":{"text":"config.NormalizeEffort (cognitive 37): config.NormalizeEffort has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17, match/switch 17, boolean chains 3 (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":"internal/config/effort.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"83a57d26d8128de043c173452a17695acd9baf485c3da70f3f5681ade8966fa1"}},{"ruleId":"D2","level":"warning","message":{"text":"control.DecidePlannerRoute (cognitive 37): control.DecidePlannerRoute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 25, boolean chains 12. 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":"internal/control/planner_gate.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bb085bf97d2f1e4761fec4d9c3e0115667f4ace162d8510f30dde4380faf238"}},{"ruleId":"D2","level":"warning","message":{"text":"Conn.dispatch (cognitive 37): Conn.dispatch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, match/switch 6, boolean chains 4 (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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5b2c37972f11609d821c9338a566fafef20b00ff393cc995165c2fae6a6b91d"}},{"ruleId":"D2","level":"warning","message":{"text":"sandbox.resolveShell (cognitive 37): sandbox.resolveShell has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, boolean chains 5, loops 4, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 15 of the 37 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 78, 67, 95). 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":"internal/sandbox/shell.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"a857954a966e1d343d4e835aa5d66531dfc50f32bf9b8baa2fa670a466f1cc68"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.models (cognitive 37): Server.models has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 7, boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/serve/serve.go"},"region":{"startLine":1227}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ccb83bbe04dac7ae9cd00254a21b6e007ae98cdef2b6d3228b43eadafb8be2c"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.flushPending (cognitive 37): Client.flushPending has cognitive complexity 37 (threshold 15). Drivers by points: if/else 23, loops 13, boolean chains 1 (nesting depth added 17). Of this number, 32 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":"internal/telemetry/client.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a4aa0529779aa70052b5916b6e45fcea14b2f0ab8d2d46134adf7072decb119"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.allCommandHints (cognitive 37): builtin.allCommandHints has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, loops 8, 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":"internal/tool/builtin/completestep.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"6178ca16a66d30327b4b4a0ef136924d0f2f60f773ba0994b7b12a16757dd9a4"}},{"ruleId":"D2","level":"warning","message":{"text":"codeIndex.collect (cognitive 37): codeIndex.collect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, boolean chains 3, loops 1 (nesting depth added 15). Of this number, 16 points are the body\u0027s own statements and 21 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":"internal/tool/builtin/codeindex.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5c230535f64a4d411b33c5facf10eefbe5cbc194266fc13a6fb60ac3e2238d6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.resolveLinuxDesktopIcon (cognitive 36): main.resolveLinuxDesktopIcon has cognitive complexity 36 (threshold 15). Drivers by points: loops 18, if/else 15, boolean chains 3 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/external_opener_linux.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f13cc7740230c12b92f30cb077d7bb1785510e5c189efddddcbbb568007d17e"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ensureTabControllerWorkspaceAdmissionHeld (cognitive 36): App.ensureTabControllerWorkspaceAdmissionHeld has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, boolean chains 11 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":1653}}}],"partialFingerprints":{"codehealthFindingId/v1":"a607ce1ec21a3a3a9049ba4363a702c2651bf83c60ee0f6a4b13f68043b4647c"}},{"ruleId":"D2","level":"warning","message":{"text":"App.CopyThemePack (cognitive 36): App.CopyThemePack has cognitive complexity 36 (threshold 15). Drivers by points: if/else 33, boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_app.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"da9380b8c4fddf74e66bf2ea1a9b37f110e2b43568cdd2b172b334385d50d74a"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.searchBotProjectsFallback (cognitive 36): bot.searchBotProjectsFallback has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 2 (nesting depth added 19). Most of this is not in the body itself: 9 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 682). 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":"internal/bot/project_index.go"},"region":{"startLine":675}}}],"partialFingerprints":{"codehealthFindingId/v1":"555baf54b5886e4a305119453ffbae54c0b2e19fc8ec26d750e00990d806da6d"}},{"ruleId":"D2","level":"warning","message":{"text":"renderSink.Emit (cognitive 36): renderSink.Emit has cognitive complexity 36 (threshold 15). Drivers by points: if/else 33, match/switch 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":"internal/bot/render.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"55fb672ffaa8b4d1ef95dbea7df1dea252a30a7d3295473ed5142bd484c2a2e2"}},{"ruleId":"D2","level":"warning","message":{"text":"Ledger.HasHostReviewCoverageAfter (cognitive 36): Ledger.HasHostReviewCoverageAfter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, loops 8, boolean chains 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":"internal/evidence/evidence.go"},"region":{"startLine":874}}}],"partialFingerprints":{"codehealthFindingId/v1":"8118aefc66af76cea4ee6b5d2923355c858dce26d7f94e66eed8b446479fa8e6"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.MigrateV2 (cognitive 36): Store.MigrateV2 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/memory/store_v2.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"f807ce9e5632e64bf7c04b1e98978c37e3dba03d27ae82e65ef89e834c181cb7"}},{"ruleId":"D2","level":"warning","message":{"text":"docsTool.search (cognitive 36): docsTool.search has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, boolean chains 6, loops 5 (nesting depth added 13). Of this number, 35 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":"internal/productdocs/docs.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc12e374daead4f53d086b3d6fae614c69161073314b6951b6b0e7ad265f606d"}},{"ruleId":"D2","level":"warning","message":{"text":"client.streamWithPrefixContinuation (cognitive 36): client.streamWithPrefixContinuation has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, boolean chains 6, loops 3, match/switch 3 (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":"internal/provider/openai/openai.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc33e8295e355613571412adddd63dfc51c077a59680a46ff55d5d6d2c1c63db"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.verifyStepEvidence (cognitive 36): builtin.verifyStepEvidence has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 4, match/switch 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/completestep.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b96f34162c3ff9262cb93f90b1dad68b3f4476bcd3cba34a5e9e94682a32e6a"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SetEffortForTab (cognitive 35): App.SetEffortForTab has cognitive complexity 35 (threshold 15). Drivers by points: if/else 33, 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":"desktop/app.go"},"region":{"startLine":10185}}}],"partialFingerprints":{"codehealthFindingId/v1":"60d5e1b061cebd4971ce3107f3877506a253cf987d93371c7518e13eecd5eac0"}},{"ruleId":"D2","level":"warning","message":{"text":"App.openTopicTabWithActivation (cognitive 35): App.openTopicTabWithActivation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":2360}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f4131ad5ed6b319ae2d96f2cd42fb9f59afd4cb1803cada6cb6b1d4f443a73a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.loadWindowsStagedReleaseUnit (cognitive 35): main.loadWindowsStagedReleaseUnit has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 6, loops 1 (nesting depth added 13). Of this number, 34 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":"desktop/cmd/update-helper/release_unit.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"8914bcdd7bc7b34ffb454d5c408ab1db5d30e8c20cf6e806149c5e9e36cf2542"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.UndoRewind (cognitive 35): Store.UndoRewind has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, loops 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/checkpoint/transaction.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bff06740d44b688d0d959e49a69d5c38926c54f53478f1cc2882e65c8837d4f"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.Update (cognitive 35): chatTUI.Update has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, boolean chains 11, 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":"internal/cli/chat_tui.go"},"region":{"startLine":876}}}],"partialFingerprints":{"codehealthFindingId/v1":"d01ce9767990a9f026c3403c511db1460c417f3d7c90fc8a67d4b4ac4e8e8692"}},{"ruleId":"D2","level":"warning","message":{"text":"goalMachine.advance (cognitive 35): goalMachine.advance has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 17, if/else 15, match/switch 3 (nesting depth added 6). 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":"internal/control/goal.go"},"region":{"startLine":504}}}],"partialFingerprints":{"codehealthFindingId/v1":"d85ad9efa967bf800eb3a70af574a399a2f2dc570d709acf2e2353d562eff6ee"}},{"ruleId":"D2","level":"warning","message":{"text":"history.extractDocuments (cognitive 35): history.extractDocuments has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, boolean chains 5, loops 5, 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":"internal/history/search.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"92dc96ffbdf55d261b93dbfbcccdd85d372a73fbee9a8434583a4a1e983b0a34"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.applyInstallMCP (cognitive 35): installSourceTool.applyInstallMCP has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 5, loops 1, match/switch 1 (nesting depth added 12). Of this number, 31 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":"internal/installsource/apply.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb86a93a65d7a845ec4570c48427a977b0bbe07c7d2fa9d70fd9780d8e9bb92f"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.planLocal (cognitive 35): installSourceTool.planLocal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, boolean chains 8, loops 4 (nesting depth added 12). Of this number, 34 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":"internal/installsource/plan.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"f09d0393f96c534cbdbb734b1bff1c5c90a85f50885f9d6be5f25179051e3101"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.RecordClaimedFileUpdateInstalled (cognitive 35): repair.RecordClaimedFileUpdateInstalled has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, loops 3, 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":"internal/repair/update.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"deffe939cba77deb23e8481d8d61d9d71b5e1077d4a041048c69ae2f406c2e78"}},{"ruleId":"D2","level":"warning","message":{"text":"readSessionTool.Execute (cognitive 35): readSessionTool.Execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, loops 5, boolean chains 4, match/switch 2, jumps 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":"internal/tool/sessiontool/sessiontool.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"eed6768985602b50b6521a125e25b1664eb8e2db6ce59668421e2f7bdbf60d79"}},{"ruleId":"D2","level":"warning","message":{"text":"tabEventSink.Emit (cognitive 34): tabEventSink.Emit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, boolean chains 5, 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":"desktop/tabs.go"},"region":{"startLine":1547}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecbc8968bad9aa38125f8e98cb56a50b8bf816496680cc403bb3e59d2bf8264f"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.fileItems (cognitive 34): chatTUI.fileItems has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, loops 5, boolean chains 2 (nesting depth added 13). Of this number, 33 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":"internal/cli/complete.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede346a5fb2fdbc1f47e587f76ee87e6f36c12d3ee46ba0388fb197e65f23795"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.WriteSessionBundle (cognitive 34): doctor.WriteSessionBundle has cognitive complexity 34 (threshold 15). Drivers by points: if/else 31, loops 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/doctor/session_bundle.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"4334ceb3448aea813e59f85059d51cb7614579e51a5afde40d155b2c6dd7474e"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.Start (cognitive 34): plugin.Start has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, loops 3, boolean chains 2 (nesting depth added 15). Of this number, 17 points are the body\u0027s own statements and 17 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":"internal/plugin/plugin.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"84784b1022e9e0de5db6bac54f8de0844fec2b2b058e1e1625594997792256e8"}},{"ruleId":"D2","level":"warning","message":{"text":"lazyTool.Execute (cognitive 34): lazyTool.Execute has cognitive complexity 34 (threshold 15). Drivers by points: if/else 30, match/switch 2, boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/plugin/lazy.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2b3bd574af546ce7802df400bafb3f9bf651c38ce7b3874018f7a5aa0177a5e"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.marshalEvidenceWithinBudget (cognitive 34): recovery.marshalEvidenceWithinBudget has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21, boolean chains 10, 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":"internal/recovery/reviewer.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"f486affc696ab5dd5435ee8a167ff0963d080e33987ba4eeff8b690fa0a790a2"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.ValidateRepairPlan (cognitive 34): repair.ValidateRepairPlan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, boolean chains 5, match/switch 5, 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":"internal/repair/plan.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"3335bed2c070accacca5a52ab438d5a6c073319bcd2320d1a3c1e9c39b0422fa"}},{"ruleId":"D2","level":"warning","message":{"text":"conn.dispatch (cognitive 34): conn.dispatch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, boolean chains 3, 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":"sdk/go/wire.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"be62e22d07c7431b0288d888bc77d529d282aca835af97dee6fc62c8d3de3f44"}},{"ruleId":"D2","level":"warning","message":{"text":"App.indexedBlankTopicIDLocked (cognitive 33): App.indexedBlankTopicIDLocked has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24, loops 5, boolean chains 4 (nesting depth added 10). 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":"desktop/tabs.go"},"region":{"startLine":2887}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ca58441d1865bedd02158c1168f6f740a9314d53f6bcc7290aeb86eb730a7b1"}},{"ruleId":"D2","level":"warning","message":{"text":"service.applyPendingSessionConfig (cognitive 33): service.applyPendingSessionConfig has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, 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":"internal/acp/service.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"50b293d675fd389098a80c37df137f485cc097b791f0d61639a28833f037f5dd"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.mcpCapabilityAllowlist (cognitive 33): agent.mcpCapabilityAllowlist has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, match/switch 2, boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/task.go"},"region":{"startLine":1451}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6865ccc94ea7a2ec6376f55350146978e0ead8e3ec9efc570d7dc40b240187b"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.finishToolExecution (cognitive 33): Agent.finishToolExecution has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 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":"internal/agent/execute_one.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"25bef03ee112f8abcf856ac0f4fedc31606b2b472f5c4547c9f47b59009a4496"}},{"ruleId":"D2","level":"warning","message":{"text":"adapter.readOutboundFile (cognitive 33): adapter.readOutboundFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, 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":"internal/bot/feishu/outbound_media.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f88c57aed72940f7a99cc89f44b89680e07d3cf1dc34617ec2ba44df6990f71"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.machineTasks (cognitive 33): cli.machineTasks has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 5, boolean chains 2 (nesting depth added 16). 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, split the body into named stages: move each independent 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":"internal/cli/task_machine.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"455dbadab39d471554a6cbf622b3f481ada44a0671186539829e6bb4620f5042"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.upgradeCommand (cognitive 33): cli.upgradeCommand has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, boolean chains 3 (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, 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":"internal/cli/upgrade.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"97d09579ce98ecf9a112d8f8b23c377a1b975b3ed6dd106cd4f89daf971f8c1f"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.ArchiveSupersededPendingAppBundleUpdate (cognitive 33): repair.ArchiveSupersededPendingAppBundleUpdate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 4 (nesting depth added 3). Of this number, 26 points are the body\u0027s own statements and 7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/update_legacy.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"86ad5d4e55cd0149d33900d8b63a0cf80c03a641be00a90e24aa0c0f9380246c"}},{"ruleId":"D2","level":"warning","message":{"text":"main.historyTodoArgsWithCompleteSteps (cognitive 32): main.historyTodoArgsWithCompleteSteps has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, boolean chains 3, loops 3, match/switch 3 (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":"desktop/app.go"},"region":{"startLine":6347}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6b9656c6dd44c0db3803c3e29baee73a3dd9974a1d97ee89c2910fac808aceb"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ensureBlankTab (cognitive 32): App.ensureBlankTab has cognitive complexity 32 (threshold 15). Drivers by points: if/else 31, 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":"desktop/tabs.go"},"region":{"startLine":2564}}}],"partialFingerprints":{"codehealthFindingId/v1":"a09bd4aed2f070be4edc4daa04ce96a110d2975e605e181846f9805fd8689032"}},{"ruleId":"D2","level":"warning","message":{"text":"service.openExistingSession (cognitive 32): service.openExistingSession has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, boolean chains 3, match/switch 1 (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":"internal/acp/service.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"07f15d851669e510eb862422aeaac03c0bdd83b90434c292bcb93c98a7099686"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.importJsonlSessions (cognitive 32): agent.importJsonlSessions has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, 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":"internal/agent/migrate.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fc3fa224cd49557303e099b262433efaeef1085e18cfb3007124a9241bc99bb"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.normalizeMissingReasoningIncident (cognitive 32): agent.normalizeMissingReasoningIncident has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, boolean chains 7 (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":"internal/agent/reasoning_warn_state.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"b45313adf80465a7019318fdb25d513e348a437dbdb408c47336e8aa0d574a0d"}},{"ruleId":"D2","level":"warning","message":{"text":"FleetTool.runFleet (cognitive 32): FleetTool.runFleet has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 4, match/switch 2 (nesting depth added 8). Of this number, 26 points are the body\u0027s own statements and 6 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":"internal/agent/fleet.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf9b0ec5944e9d1f0bd2e368931fa209fefeac96b0cec57368ec2a0fbfc04cc"}},{"ruleId":"D2","level":"warning","message":{"text":"BotGateway.handleDesktopCommand (cognitive 32): BotGateway.handleDesktopCommand has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, match/switch 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":"internal/bot/desktop.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"abad61194bb1f25eca7dbea0ae9dc9cfbccab16dfa243736810cb8b06b2330f9"}},{"ruleId":"D2","level":"warning","message":{"text":"capability.MCPServerEntries (cognitive 32): capability.MCPServerEntries has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18, boolean chains 7, loops 5, 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":"internal/capability/catalog.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"8885f789688c92864ff48b380b452c92dffd0ef998236f206c258d1ec3dde587"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.RenderText (cognitive 32): capdiag.RenderText has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, loops 6 (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":"internal/capdiag/render.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfd87f5c895d230749396c69547a6f77f30b854a58d1ae23c4dc030f7911a70b"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.collapseToolOutput (cognitive 32): chatTUI.collapseToolOutput has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19, loops 10, boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":2689}}}],"partialFingerprints":{"codehealthFindingId/v1":"0819bff3d00b5b4c865683b44db9916f9eb716f76381ce1507e5a7f17be99c12"}},{"ruleId":"D2","level":"warning","message":{"text":"config.loadForRoot (cognitive 32): config.loadForRoot has cognitive complexity 32 (threshold 15). Drivers by points: if/else 31, boolean chains 1 (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":"internal/config/load.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"031fb1d9e00cb0103f85cc028198512b892f6df1a467d7ebb642d3b4956bbebf"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.AdvanceSerialTodo (cognitive 32): evidence.AdvanceSerialTodo has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 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":"internal/evidence/evidence.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5347991b886f1f8a54d176d791a2e0eef80b3e37aead44d0ac9fb5677f35847"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.loadSessionArtifacts (cognitive 32): Manager.loadSessionArtifacts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 3, loops 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":"internal/jobs/jobs.go"},"region":{"startLine":1535}}}],"partialFingerprints":{"codehealthFindingId/v1":"056303915d286333e29508a5e3186a7a2469ee101091762a43dd2bff0288d74b"}},{"ruleId":"D2","level":"warning","message":{"text":"productdocs.loadCatalogWithReleaseNotes (cognitive 32): productdocs.loadCatalogWithReleaseNotes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, loops 4, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/productdocs/docs.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"0683ec120a9ec0126a056a4ece949e5fa15ff8f4bef7075e622d0d677841ae6b"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SetTokenModeForTab (cognitive 31): App.SetTokenModeForTab has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, boolean chains 3 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":10328}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf300c289abbffd41949d90ca1d4b7dd6c82c6ffd4529c993c9e7494f6315261"}},{"ruleId":"D2","level":"warning","message":{"text":"App.closeTab (cognitive 31): App.closeTab has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, 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":"desktop/tabs.go"},"region":{"startLine":3040}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bdbcddd38a7591665f61d56ca0f57930144c0e4f32cc77c1134619dde4f61ba"}},{"ruleId":"D2","level":"warning","message":{"text":"App.tabSnapshotLoop (cognitive 31): App.tabSnapshotLoop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, boolean chains 1, 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":"desktop/tabs.go"},"region":{"startLine":4398}}}],"partialFingerprints":{"codehealthFindingId/v1":"01522423965a4ef0b5a7308f0ba58ebb63b93ae62a415082aca9e8c692f06848"}},{"ruleId":"D2","level":"warning","message":{"text":"Coordinator.Run (cognitive 31): Coordinator.Run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, boolean chains 3 (nesting depth added 10). 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 into named stages: move each independent 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":"internal/agent/coordinator.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ec31a5a95138ea0006a26ea4468a2a76cf5e732e61a28b50bdafd4f85d81656"}},{"ruleId":"D2","level":"warning","message":{"text":"BotGateway.getOrCreateSession (cognitive 31): BotGateway.getOrCreateSession has cognitive complexity 31 (threshold 15). Drivers by points: if/else 31 (nesting depth added 13). Of this number, 29 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":"internal/bot/gateway.go"},"region":{"startLine":2200}}}],"partialFingerprints":{"codehealthFindingId/v1":"925136f09c3df352defa7085380cdf764d6c5145f1b4ecc357f60f24898ce7d1"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.CaptureBeforeFromChange (cognitive 31): Store.CaptureBeforeFromChange has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dafdede6bba44a1cbbd41a809c9d1a3c7a663520b7b65a75d83a00b9c290af5"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.machineRecoveries (cognitive 31): cli.machineRecoveries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20, boolean chains 6, loops 3, match/switch 2 (nesting depth added 12). Of this number, 30 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":"internal/cli/session_machine.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e922b42394224f15d33ea4bf8193a2b78562d2436f1bd653d2f4ee2a64e783b"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleRewindKey (cognitive 31): chatTUI.handleRewindKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, match/switch 5 (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":"internal/cli/rewind.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"562251ebaa24b079de9120ad843980f322bc912abbc52b993317233b60ccca98"}},{"ruleId":"D2","level":"warning","message":{"text":"config.upsertTOMLSectionKey (cognitive 31): config.upsertTOMLSectionKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, boolean chains 3, 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":"internal/config/edit.go"},"region":{"startLine":1892}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4f993e3b796724da53d4df4a627b840a1313b283bdb81460c7e72116d7f2295"}},{"ruleId":"D2","level":"warning","message":{"text":"fileref.Search (cognitive 31): fileref.Search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, boolean chains 6, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 88). 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":"internal/fileref/search.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ccbe8913c6e08d30d6b201dc9f4afabd65ebcb233381be65ba90c50ddd358e2"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.ensureBinary (cognitive 31): bootstrap.ensureBinary has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, 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":"internal/remote/bootstrap/install.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"a289a1e7d1e5fd04d6dff227d0f1a87b72df5c3e6ca2c250e70540077da86e1f"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.probeProviderNetwork (cognitive 31): repair.probeProviderNetwork has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 4, match/switch 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/diagnose.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"74fa5b21e225587aa13a3486b218c70e6a192088be32b1a57d7c48321d649aa8"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.pruneConfigSnapshot (cognitive 31): repair.pruneConfigSnapshot has cognitive complexity 31 (threshold 15). Drivers by points: if/else 30, 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":"internal/repair/snapshot.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7dd9067b5c2315439b1bf7ef90e06ba21f293422a8beab128a06d28acd5054d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.htmlToText (cognitive 31): builtin.htmlToText has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, boolean chains 3, match/switch 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/webfetch.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"174f18a82b3e2ded4b442dffdf6edf0b3fc363d24103e4bde2b263e45ca4d977"}},{"ruleId":"D2","level":"warning","message":{"text":"main.reconcileDesktopTrashSessionArtifacts (cognitive 30): main.reconcileDesktopTrashSessionArtifacts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, 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":"desktop/sessions.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfdc534b53ff6c421760888645c6b6d418c46aef8659f462d103e7ffa59b67c9"}},{"ruleId":"D2","level":"warning","message":{"text":"main.writeThemeZip (cognitive 30): main.writeThemeZip has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 2 (nesting depth added 7). 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":"desktop/theme_import.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"0df48060f5ac00aff241e5fb5d67d634a15317d7ef1621de358c1582f71f1c0f"}},{"ruleId":"D2","level":"warning","message":{"text":"service.rebuildSessionLocked (cognitive 30): service.rebuildSessionLocked has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 5, loops 2, match/switch 1 (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":"internal/acp/service.go"},"region":{"startLine":1705}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eb4429514b3cc801dbbce6f65e846028d8a7407e26ac8eb4fe3ed171973f1c2"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.preflightSessionEventValue (cognitive 30): agent.preflightSessionEventValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 4, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/session_events.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"504ce431319c713d867349024a7a72ce70b45fcd37d40ec4bd64a64e18f5286a"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.displayPath (cognitive 30): capdiag.displayPath 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":"internal/capdiag/paths.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe60dacfc73884c1ae4879eb2527fd3f73d3aea4a85e870ae506ba964901cffb"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.load (cognitive 30): Store.load has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, loops 7, boolean chains 3 (nesting depth added 15). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 266). 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a7487430506e47ddc515e39080dce26c3d4be9d110914e710a7dbc31043dcb6"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.splitAllowedToolRules (cognitive 30): cli.splitAllowedToolRules has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, loops 3, match/switch 3, boolean chains 2 (nesting depth added 18). Of this number, 26 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":"internal/cli/cli_flags.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"047d810005812c4623a25cb36518457ebac6dfd35267fd2e5d886074fb9ac86d"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.editBuiltinSubagentProfile (cognitive 30): cli.editBuiltinSubagentProfile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, 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":"internal/cli/subagent.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"3917adcad56da9b32168b1ba80640d8c7b49ba5c0f0e596ae7ff05db0842fe07"}},{"ruleId":"D2","level":"warning","message":{"text":"mdRenderer.renderTable (cognitive 30): mdRenderer.renderTable has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14, loops 12, boolean chains 2, match/switch 2 (nesting depth added 9). Of this number, 28 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":"internal/cli/md.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"830c8aa3dbd8ec8209914874cd673bfecc0a31ae6021e02c620fe815069321ba"}},{"ruleId":"D2","level":"warning","message":{"text":"config.advanceTOMLStringState (cognitive 30): config.advanceTOMLStringState has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14, loops 9, match/switch 5, 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":"internal/config/load.go"},"region":{"startLine":1071}}}],"partialFingerprints":{"codehealthFindingId/v1":"86c960a04527833ef849c11144efd4452be291cf9163f1a0b5b7b97a20943dfc"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.resolveNewSessionChatModel (cognitive 30): Config.resolveNewSessionChatModel has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 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":"internal/config/config.go"},"region":{"startLine":1997}}}],"partialFingerprints":{"codehealthFindingId/v1":"a911ef22775a79dd87eb36dd60aa0e91f0dfef7c697cdb4f07795fdbcae2887e"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.Rewind (cognitive 30): Controller.Rewind has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, boolean chains 7 (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":"internal/control/rewind.go"},"region":{"startLine":258}}}],"partialFingerprints":{"codehealthFindingId/v1":"11dee9516382b167b9ce22b13396ded15e308a127e048e14334902fa295ba238"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.quarantineExistingAppBundleUpdateBackup (cognitive 30): repair.quarantineExistingAppBundleUpdateBackup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 2, loops 1 (nesting depth added 9). Of this number, 25 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/update.go"},"region":{"startLine":1421}}}],"partialFingerprints":{"codehealthFindingId/v1":"67bbc608b20668edd12954980dc5ca160cff3d77b1a666741ba5c8ab0f8c32c8"}},{"ruleId":"D2","level":"warning","message":{"text":"App.deleteTopic (cognitive 29): App.deleteTopic has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, boolean chains 3, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":7376}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ca9842826570cd2ed711e9949b6f7f046fb7b4f3a48ac97867a38c87d59a389"}},{"ruleId":"D2","level":"warning","message":{"text":"main.run (cognitive 29): main.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, match/switch 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":"cmd/reasonix-legacy-migrator/main.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"97afe0aeef3d6aa136ed068b726813b803c914380aa9e905bb2d9134a8ea0651"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryTaskAdvisoryClauseRequestsMutation (cognitive 29): agent.deliveryTaskAdvisoryClauseRequestsMutation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, loops 6, boolean chains 4 (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":"internal/agent/agent.go"},"region":{"startLine":2289}}}],"partialFingerprints":{"codehealthFindingId/v1":"27e08da7fead72382d19d37fed61d00349fbcdbe13fc56cb38cdc2c3de8cfd33"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryTaskStartsWithMutation (cognitive 29): agent.deliveryTaskStartsWithMutation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 8, boolean chains 4 (nesting depth added 15). Of this number, 26 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":"internal/agent/agent.go"},"region":{"startLine":2342}}}],"partialFingerprints":{"codehealthFindingId/v1":"59f5ffdb6267f8aaf18ac5c5299afa2015d3a42a11f2c9f16ec9fc955181ddac"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.loadSessionUserMessagesWithLimits (cognitive 29): agent.loadSessionUserMessagesWithLimits has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, 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":"internal/agent/session_content.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b7095e3487e4ca80da2c6e6832d0fa69402c6bbe9f61025b34c2fd74ab9192c"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.maintainStaleToolResults (cognitive 29): Agent.maintainStaleToolResults has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, 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":"internal/agent/prune.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0ffcd8e25eb314d8ba27a7e61784ae864ddc58279fe41bb3cc3b50acc5d8c79"}},{"ruleId":"D2","level":"warning","message":{"text":"capability.RenderTransientBlock (cognitive 29): capability.RenderTransientBlock has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, match/switch 6, boolean chains 5, 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":"internal/capability/capability.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"d96d26449829ddfb312d52ace39914082c37c2ac930d748a43d40801b9cce47b"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.replaySectionsForWithAssistantRenderer (cognitive 29): cli.replaySectionsForWithAssistantRenderer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 7, match/switch 2 (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":"internal/cli/chat_tui.go"},"region":{"startLine":5254}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c906450fa4454d560da99a2f5a0be7bcd58998fd528ef3a046a7485644b320e"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.recoverOrphanedPasteLabelsFromHistory (cognitive 29): cli.recoverOrphanedPasteLabelsFromHistory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 7, 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":"internal/cli/chat_tui_paste.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c6a187d31b359c6ad7ef786d9d21d5765ff64ce3ee22729b9503cb42d5d4f2"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.wrapComposerLine (cognitive 29): cli.wrapComposerLine has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, loops 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":"internal/cli/composer_selection.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"cac8912cc44349b122eb0a27b173c3427c43bff7631266e688e6b26604c3a257"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.streamToolOutput (cognitive 29): chatTUI.streamToolOutput has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, boolean chains 2, loops 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":"internal/cli/chat_tui.go"},"region":{"startLine":2339}}}],"partialFingerprints":{"codehealthFindingId/v1":"186464d3a883151ad2257e70e306d3b6a82a87be62be1d3b1dc0220cdffcb76a"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.buildMCPSnapshot (cognitive 29): chatTUI.buildMCPSnapshot has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 9, match/switch 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":"internal/cli/mcp_manager.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dc4dd19e5faec75e950c32320957bc17365758a01d7bbcc1ace7c81c1a9072d"}},{"ruleId":"D2","level":"warning","message":{"text":"eventwire.ToWireExtensionSurface (cognitive 29): eventwire.ToWireExtensionSurface has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 9 (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":"internal/eventwire/wire.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bcebccc763c28ecb1a5cd6d4929b74a4a84c69830e3a80d9963123b95f19e9d"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.globThemePattern (cognitive 29): pluginpkg.globThemePattern has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 12 (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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":706}}}],"partialFingerprints":{"codehealthFindingId/v1":"aec85eea8a41583d77be47ef89fa5209abf000ff14cdd9138cd202bedd11592d"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.PreviewRepairPlan (cognitive 29): repair.PreviewRepairPlan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, match/switch 2, 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":"internal/repair/plan.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f9617a075e0a3a45ba13a9d730001e9398d837f879a3bacfe49ddba48792018"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.markUpdateHealthyMatching (cognitive 29): repair.markUpdateHealthyMatching has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2096, 2089). 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":"internal/repair/update.go"},"region":{"startLine":2054}}}],"partialFingerprints":{"codehealthFindingId/v1":"4265e7bbf682bf944d6a5c12ca4c0bf032a386b1ef487089e06fec8c7d1cde6f"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.validateMutablePath (cognitive 29): Store.validateMutablePath has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, loops 3, 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":"internal/skill/skill.go"},"region":{"startLine":1109}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ced0b17e6321a482cc57b70ebd33f02f80072428fa5dad14d8205d426477973"}},{"ruleId":"D2","level":"warning","message":{"text":"updateSink.replay (cognitive 28): updateSink.replay has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 4, match/switch 2 (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":"internal/acp/dispatch.go"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"02ec1f28b4a617cd2a0b357aac434a73fa1cb39dff992b8094ed18a1276b3e39"}},{"ruleId":"D2","level":"warning","message":{"text":"UseCapabilityTool.Execute (cognitive 28): UseCapabilityTool.Execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/usecapability.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"21267aab06a991fd1da28ca1c57aef177cb8b5e39c4bf9c1bd17751bbf221778"}},{"ruleId":"D2","level":"warning","message":{"text":"boot.subagentEffectiveIdentity (cognitive 28): boot.subagentEffectiveIdentity has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 3 (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":"internal/boot/boot.go"},"region":{"startLine":2527}}}],"partialFingerprints":{"codehealthFindingId/v1":"44b0f89d6c53562d08b42ec313735c90f5c62b86ba4d4dbd3401d93fd641b9d8"}},{"ruleId":"D2","level":"warning","message":{"text":"BotGateway.handleMessage (cognitive 28): BotGateway.handleMessage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, match/switch 2, 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":"internal/bot/gateway.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3f1684a9c95ce959d0589cc6167965e8d1228a04470a79be3e0d27c3aaeffe7"}},{"ruleId":"D2","level":"warning","message":{"text":"adapter.connectGateway (cognitive 28): adapter.connectGateway has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, match/switch 4, loops 2, boolean chains 1 (nesting depth added 8). Of this number, 19 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":"internal/bot/qq/gateway.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a63988713f721664e395023512a34993059abc9c51073ed699287f144d585f6"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.defaultMCPNameFromArgv (cognitive 28): cli.defaultMCPNameFromArgv has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/mcp.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"57b4e29220f7e88809820ec3cb24cc984b0f1eaa93e040390e8f244102d26596"}},{"ruleId":"D2","level":"warning","message":{"text":"control.readFileRefUnscoped (cognitive 28): control.readFileRefUnscoped has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 1049). 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":"internal/control/refs.go"},"region":{"startLine":1039}}}],"partialFingerprints":{"codehealthFindingId/v1":"6912d3b5455c971f7e3946ce2e347a36db25a7837a0f9b106e63d6b9260bb33a"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.hasCommandStringFlag (cognitive 28): hook.hasCommandStringFlag has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 3, boolean chains 2 (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":"internal/hook/windows_compat.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2bc5bcb34ce8a9656ef330c1742549f8c3570e2f748bc5c283fb658f53df2c5"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.StartForSession (cognitive 28): Manager.StartForSession has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 2, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 469). 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":"internal/jobs/jobs.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f943d4fbfcb03b4a3a664def082aa364a4e2d3b69beffd4aad934d90fa143ef"}},{"ruleId":"D2","level":"warning","message":{"text":"mcpregistry.normalize (cognitive 28): mcpregistry.normalize has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, boolean chains 4, loops 2, 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":"internal/mcpregistry/registry.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2f3b3da9b30b50316c9a103738fea9b3741785b860257805a30fd740db71c6a"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.ListArchived (cognitive 28): Store.ListArchived has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 3, boolean chains 2 (nesting depth added 14). 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, split the body into named stages: move each independent 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":"internal/memory/store.go"},"region":{"startLine":710}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2ce7017b31c9c4b990d3309221c0b8e5da3f94bc588d22af1d5ff720b527e1b"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.findArchivedByPath (cognitive 28): Store.findArchivedByPath has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/memory/store_v2.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ad9638a916f91753b0f75f2671958f9edb5c253840490039eccf388fd748469"}},{"ruleId":"D2","level":"warning","message":{"text":"httpTransport.readSSEResponse (cognitive 28): httpTransport.readSSEResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 2, loops 1 (nesting depth added 10). Of this number, 15 points are the body\u0027s own statements and 13 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":"internal/plugin/transport_http.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"4866a5a50e754c06f28ae02e74e21f22800b74a8e72f7163852c96c9fb555f7b"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.acquireServeLock (cognitive 28): bootstrap.acquireServeLock has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 3, 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":"internal/remote/bootstrap/lock.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"658c8c2dd00e6e2e7c70dd0560681a1b0551b9696e835574fa1e628665f787df"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.supervise (cognitive 28): Client.supervise has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 2, loops 1 (nesting depth added 13). Of this number, 27 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":"internal/remote/client.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"34cf12254d86e38c0ee1c257ab7ab67b0dd0eb6bfd97130bb05910fa2465bae5"}},{"ruleId":"D2","level":"warning","message":{"text":"deleteSymbol.findSymbol (cognitive 28): deleteSymbol.findSymbol has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 7 (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":"internal/tool/builtin/delete_symbol.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"7685210c9354c2bc8677e6dd51dea53a7285c02f129b1c3895422a21dc7f802c"}},{"ruleId":"D2","level":"warning","message":{"text":"SessionDataGuard.CommandHint (cognitive 28): SessionDataGuard.CommandHint has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 5, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/session_guard.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d42ae036bb60f3c735a9d64cc9f19206b02f55062021ae0bcddd43c0c9956b7"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.ReadContentRef (cognitive 28): extension.ReadContentRef has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"sdk/go/sdk.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"27d05fe03f7bce5f6fb3e1dcb48f55a7d516de32465f0d40dce1333c6c8849b9"}},{"ruleId":"D2","level":"warning","message":{"text":"App.InstallMCPServer (cognitive 27): App.InstallMCPServer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, 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":"desktop/app.go"},"region":{"startLine":8891}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6bc53c4643b63b007d6df6f95f174a9d7e7adab64c06d508d16fb3a27950700"}},{"ruleId":"D2","level":"warning","message":{"text":"App.applySessionBindingToTab (cognitive 27): App.applySessionBindingToTab has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, boolean chains 11 (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":"desktop/tabs.go"},"region":{"startLine":4065}}}],"partialFingerprints":{"codehealthFindingId/v1":"05bd7b095f77734a601b11af49e4d1d95ca851e91f34bcd7ebc8df021f53b0d5"}},{"ruleId":"D2","level":"warning","message":{"text":"App.handleTabSessionRecovered (cognitive 27): App.handleTabSessionRecovered has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 5 (nesting depth added 9). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 6062). 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":"desktop/tabs.go"},"region":{"startLine":6061}}}],"partialFingerprints":{"codehealthFindingId/v1":"27c717fcfb4106f22fea0dbd0259e5a53f3d10c3c15404e19372301048097cf3"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateContract (cognitive 27): main.validateContract has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/signpath-contract/main.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddc421819db35997def6a1ab2c96c7a638f9459f16d246c4eba210ca78858788"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.extractPlannerDecisionOptions (cognitive 27): agent.extractPlannerDecisionOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, boolean chains 8, 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":"internal/agent/coordinator.go"},"region":{"startLine":710}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f62143f3163ce45aed4dc5333bab9c4fa947496412551e31294e9ed028b7794"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.rehomeStrandedSessions (cognitive 27): agent.rehomeStrandedSessions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, 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":"internal/agent/migrate.go"},"region":{"startLine":747}}}],"partialFingerprints":{"codehealthFindingId/v1":"342fb32b25df71dc466b05134b2c5dce84a275af90df34a05637ee7eed01eb9b"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.BindWritePaths (cognitive 27): agent.BindWritePaths has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/path_bound_tools.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ed29c7c2616bb35ec11437762fb66f132302be855cf18fc5950c41d7c06555"}},{"ruleId":"D2","level":"warning","message":{"text":"TextSink.Emit (cognitive 27): TextSink.Emit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 2, match/switch 1 (nesting depth added 12). 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":"internal/agent/textsink.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf8634aa647a7c18194a9596ae4ee68852b2d5d77e32b988ec621faa4fe495bc"}},{"ruleId":"D2","level":"warning","message":{"text":"SessionManager.TryAcquireWithQueue (cognitive 27): SessionManager.TryAcquireWithQueue has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, match/switch 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/session.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb3e2e8a0ee30fbd71f7a46ff2618f3eb2e1459982c7c042a73f4844c405bf5a"}},{"ruleId":"D2","level":"warning","message":{"text":"capability.semanticPool (cognitive 27): capability.semanticPool has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, boolean chains 5, loops 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":"internal/capability/semantic.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"72de9f0ef9b83334da20c9bebed21bd92d18243f1ad9498f6d58d2bc272ffc1c"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.mcpBrowseWithClient (cognitive 27): cli.mcpBrowseWithClient has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 2, match/switch 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/mcp.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"6520c2edfb2fa39bc607fa01597397a5df5a11217131540c3a7da7afb381021b"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.reportCommandWithIO (cognitive 27): cli.reportCommandWithIO has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, loops 2, boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/report.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e9fdc30bd8ec3159d0c391e75e51c63aee6e511b23d09999373042993addd2a"}},{"ruleId":"D2","level":"warning","message":{"text":"acpFactory.SessionConfigState (cognitive 27): acpFactory.SessionConfigState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 3 (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":"internal/cli/acp.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d36a5131f8472088300bb6bb7708a0ba2ecfe66a7c43a1b3bdd0f5b30424014"}},{"ruleId":"D2","level":"warning","message":{"text":"command.Inspect (cognitive 27): command.Inspect has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 7 (nesting depth added 12). Of this number, 24 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/command/inspect.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1914be67fd3cadf3debe4d029941c21f0834602af0c9eabe69d3719c303551a"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.resolveRefs (cognitive 27): Controller.resolveRefs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, 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":"internal/control/refs.go"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a4a7819f680ce9a9a02c352678f7b774ef4c4395fb2cf40ab8b6708e04ca9e9"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.parseV1Runtime (cognitive 27): pluginpkg.parseV1Runtime has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 7, 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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"a67aa6d515aea811ab3fae2abcc20632215cf585ba1c2d427afe93cd4739caf2"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.SendWithRetry (cognitive 27): provider.SendWithRetry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, match/switch 3, boolean chains 2, 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":"internal/provider/retry.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"4394f3fbf4ea03e28913efbc43595f966bcdd312114cb07ef0d2d37518f32575"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.gitCommandHighRisk (cognitive 27): recovery.gitCommandHighRisk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, boolean chains 11 (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":"internal/recovery/rules.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"94c9c95043c6ce5e5a62ce92307b0a4a9dc66d123bbc31d67d1a15866e719009"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.applyRepairPlanAction (cognitive 27): repair.applyRepairPlanAction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/repair/plan.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"c14f6d95771da2871a8b31eb753ddcbfea7a6e3fb53d1054483a0a7e24704db9"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.PrepareFileUpdate (cognitive 27): repair.PrepareFileUpdate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, 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":"internal/repair/update.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f08ce59609fa78f3cc9a567579b665797abad5ba49ecd879bbd4c5467edc577"}},{"ruleId":"D2","level":"warning","message":{"text":"moveFile.Execute (cognitive 27): moveFile.Execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 26, 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":"internal/tool/builtin/movefile.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"c53bbde1b7d7a22f7817d3058ae815912d2ec150925acda62b5b2585fd19103d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.scanThemeZipEntries (cognitive 26): main.scanThemeZipEntries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 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":"desktop/theme_import.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ade0a65c12f5edc2e9a897887847a923869a4967b7473273bfd54c4059cff2c"}},{"ruleId":"D2","level":"warning","message":{"text":"main.publishThemeDir (cognitive 26): main.publishThemeDir has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 3 (nesting depth added 4). Of this number, 25 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":"desktop/theme_store.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"3601cb4880c9c4c67a9d43299206331857138646037a2ddabeb176aee4daeb44"}},{"ruleId":"D2","level":"warning","message":{"text":"App.domReady (cognitive 26): App.domReady has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 3, boolean chains 1, match/switch 1 (nesting depth added 10). Of this number, 21 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"f101ea9b65f2993282c4aec48ffdef701b0e22f493ad1609af945475b72600ab"}},{"ruleId":"D2","level":"warning","message":{"text":"App.topicTrashTargets (cognitive 26): App.topicTrashTargets has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 5, boolean chains 1 (nesting depth added 11). Of this number, 23 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":"desktop/tabs.go"},"region":{"startLine":7594}}}],"partialFingerprints":{"codehealthFindingId/v1":"3829914633654a9ce4459632126aaa2fdfbb093e67ab7599ce8dc269e29f1aa5"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cleanupOwnedWindowsUpdateDirectory (cognitive 26): main.cleanupOwnedWindowsUpdateDirectory has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 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":"desktop/cmd/update-helper/main_windows.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"319f35ca14ea6a7a379a94875dbba801bfbc13a698f247ba91499d1a404d7fe4"}},{"ruleId":"D2","level":"warning","message":{"text":"main.comprehension (cognitive 26): main.comprehension has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 7, boolean chains 4 (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":"benchmarks/context-maintenance-e2e/main.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dbe7461b4ebbb1d8f7b8fc1d067d2f912d80e547e24c9386f3e20b92940f4c3"}},{"ruleId":"D2","level":"warning","message":{"text":"main.render (cognitive 26): main.render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 3, 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":"cmd/e2ebench/main.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"b031b63a882ea0b023803a5bc9f56bd2dbbb7f97b6d390b11807de189b7d2225"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.renameOverlongSession (cognitive 26): agent.renameOverlongSession has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, 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":"internal/agent/save.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f0d40edcec0733d55ba1052d943423bd840f133374ee9457b8015de1b0f40cd"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.capabilityGateFailure (cognitive 26): Agent.capabilityGateFailure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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":"internal/agent/capability_gate.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe47b1aaec0bb71ebd5c626cb251377abcc2e0600c4a6348ac718e5bc8aba17a"}},{"ruleId":"D2","level":"warning","message":{"text":"boundedllm.Call (cognitive 26): boundedllm.Call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 2, match/switch 2, loops 1 (nesting depth added 7). 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, split the body into named stages: move each independent 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":"internal/boundedllm/bounded.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a5c8cdfcf25ccd6bd67c65a9ee8ee5c304bd4aa33f404a595cb25f358bcbf8"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.collectMCP (cognitive 26): capdiag.collectMCP has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/capdiag/collect.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"1aaf8412152340a62bc3523badb61b6a8f2fa0db8ba699a40e05ee85cf246e44"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.gcLocked (cognitive 26): Store.gcLocked has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"b60e49679a0f794c37becd5f3562af98f5215debc592c459448e2451b2026af2"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.parseTaskMachineOptions (cognitive 26): cli.parseTaskMachineOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, boolean chains 6, 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":"internal/cli/task_machine.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce1121c68686610cd9d986bdb9f690512c2d160140376a8a6f5ad46559c910b0"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.collapseShellSlot (cognitive 26): chatTUI.collapseShellSlot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 6 (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":"internal/cli/chat_tui.go"},"region":{"startLine":2750}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb71ac342793167f1297e66908c5bf3d578d5864df14b620c166463126176430"}},{"ruleId":"D2","level":"warning","message":{"text":"command.LoadRoots (cognitive 26): command.LoadRoots has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 6, boolean chains 1 (nesting depth added 10). Of this number, 18 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":"internal/command/command.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"22be0fda676354f6e8b8db72d02240f52205068e8db02d192b5c1a8afade0e84"}},{"ruleId":"D2","level":"warning","message":{"text":"config.planLegacyMCPDisable (cognitive 26): config.planLegacyMCPDisable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, 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":"internal/config/edit.go"},"region":{"startLine":1322}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d7c1f8a84f89fd8c459110a5b8282d321e778c46545d37e17625b96e3489fa2"}},{"ruleId":"D2","level":"warning","message":{"text":"config.removeTOMLSectionKey (cognitive 26): config.removeTOMLSectionKey has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 5, 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":"internal/config/edit.go"},"region":{"startLine":2150}}}],"partialFingerprints":{"codehealthFindingId/v1":"10ac3bd5a271504402b282ff392a454b547458be8094ce443d11cd985a24251d"}},{"ruleId":"D2","level":"warning","message":{"text":"config.MigrateLegacyIfNeededForRoot (cognitive 26): config.MigrateLegacyIfNeededForRoot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 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":"internal/config/migrate.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"76f94292a7314a7bb02ffe8bee2b584da3eda12905e0c4e401a62d4caeccc69c"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateLegacyCredentialsIfNeededForRoot (cognitive 26): config.migrateLegacyCredentialsIfNeededForRoot has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 6, match/switch 3, boolean chains 2 (nesting depth added 11). Of this number, 25 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":"internal/config/migrate.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"a70f77ca6fc3da12e2eee5977c1294ff558988ec9b9371a1dcf4fd7f7fd40fb1"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.validateSerialSegment (cognitive 26): evidence.validateSerialSegment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 3, boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/evidence.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"6302b5116c230db65744bfef7b712eac2c2cb8b3fd18b59b95bd2c2d71a358d4"}},{"ruleId":"D2","level":"warning","message":{"text":"sdkTypeWalk.visit (cognitive 26): sdkTypeWalk.visit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, 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":"internal/extension/protocolgen/sdkgo.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f700208486336ae5454145bf5cea92b3fdb45365fc90a40705c7e990333c371"}},{"ruleId":"D2","level":"warning","message":{"text":"rpcwire.validateStrictFrame (cognitive 26): rpcwire.validateStrictFrame has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 6 (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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"88aa600980000419b08cee7bcfa122e5dd8075cd28d8024883c865d7af892513"}},{"ruleId":"D2","level":"warning","message":{"text":"sidecar.startLoadedPackages (cognitive 26): sidecar.startLoadedPackages has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 6 (nesting depth added 11). 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":"internal/extension/sidecar/manager.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"52ff69612b3fe755d5756d663b6184efc6d39862e5996691c11fc947ae05d5e0"}},{"ruleId":"D2","level":"warning","message":{"text":"mcplaunch.acquireFileLock (cognitive 26): mcplaunch.acquireFileLock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/mcplaunch/launch.go"},"region":{"startLine":422}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8ea2f278ca87eac6f72f2465150f83e0da9cba6090ae02b862f33ffc57d5136"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.maxKnownRevision (cognitive 26): Store.maxKnownRevision has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 3 (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":"internal/memory/store_v2.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a7265af38cf9aef14537295fbf1c97ad4b1de3da1cc3ea0f45afadc44046fc2"}},{"ruleId":"D2","level":"warning","message":{"text":"migration.migrateLegacySessionSources (cognitive 26): migration.migrateLegacySessionSources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 3, boolean chains 2 (nesting depth added 8). Of this number, 19 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":"internal/migration/migration.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cc7d789ac116da8b03639ab374ebbad5a1141e66e6d9a87fa605d644c646f17"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.buildReviewEvidence (cognitive 26): recovery.buildReviewEvidence has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, 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":"internal/recovery/reviewer.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"11e3138d93845a7087187fc005dce606d4d5f77fead3d7e807d39ed775e09e67"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.cancelPendingUpdateMatching (cognitive 26): repair.cancelPendingUpdateMatching has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 2, match/switch 1 (nesting depth added 5). Of this number, 15 points are the body\u0027s own statements and 11 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":"internal/repair/update.go"},"region":{"startLine":2191}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ed020e0fd5ee209cc7371e0cac292c25a2f0fcf6f1c67458d231961f6beb25c"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.discoveredSkills (cognitive 26): Store.discoveredSkills has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, loops 8, 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":"internal/skill/skill.go"},"region":{"startLine":587}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0e1505e62a42a9f27b5001b18437989aa3b9d17c61385c42a9a391094f9cd50"}},{"ruleId":"D2","level":"warning","message":{"text":"codeIndex.parseGo (cognitive 26): codeIndex.parseGo has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 11, loops 9, if/else 5, boolean chains 1 (nesting depth added 16). Of this number, 25 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":"internal/tool/builtin/codeindex.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"80d5d2c975caab88f783a5dbbbac0f3c8bcba47521a0b7e15efced110da5938f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.saveExclusiveExportPayloads (cognitive 25): main.saveExclusiveExportPayloads has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 1 (nesting depth added 9). 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":"desktop/app.go"},"region":{"startLine":11210}}}],"partialFingerprints":{"codehealthFindingId/v1":"a51dcfca521d8f2766b7d7650a383e0070fe15510b82dd28dadb2332eee65611"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateTrashedSessionPath (cognitive 25): main.validateTrashedSessionPath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, 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":"desktop/sessions.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"0afa164ee6679a4b76fc10e817f147fb57bdf159e30d861d69778dea78e141cc"}},{"ruleId":"D2","level":"warning","message":{"text":"main.classifyProviderPresetStatus (cognitive 25): main.classifyProviderPresetStatus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, 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":"desktop/settings_app.go"},"region":{"startLine":755}}}],"partialFingerprints":{"codehealthFindingId/v1":"deb6fdaac4c0a39bcfa786c4b89e58561a91d6e165058152aa93c21b0bd3c00d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.applyDebLinux (cognitive 25): main.applyDebLinux has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, match/switch 5, boolean chains 3, loops 1 (nesting depth added 8). Of this number, 21 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":"desktop/updater_deb_linux.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"05e24dd65f65df25c1326bbcec9cb60039814a528488f82d8dd3e6436248c578"}},{"ruleId":"D2","level":"warning","message":{"text":"main.genManifest (cognitive 25): main.genManifest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 3, match/switch 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":"desktop/cmd/sign/main.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"df2a079a3f07b691e249463ef7348a1262f6d0d0e407052d08300df35330cf5e"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runMutation (cognitive 25): main.runMutation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 4 (nesting depth added 13). Of this number, 22 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":"cmd/e2ebench/mutation.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"07c4575213fce516cfc883d911f60c2701769e6860dbcaab8ba3205b32b98732"}},{"ruleId":"D2","level":"warning","message":{"text":"service.sessionRecoveredHandler (cognitive 25): service.sessionRecoveredHandler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (nesting depth added 12). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 510). 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":"internal/acp/service.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e54b465c2309078abd5d1f7bd60454589764b8ebb414697a996a8192017b0ee"}},{"ruleId":"D2","level":"warning","message":{"text":"service.sessionList (cognitive 25): service.sessionList has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 2 (nesting depth added 9). 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":"internal/acp/service.go"},"region":{"startLine":2001}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec30bdce1fd2fb1addc819c5a563ccdbaa123c687662568c1878e200154c765f"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryTaskHasFileReference (cognitive 25): agent.deliveryTaskHasFileReference has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, match/switch 6, boolean chains 4, loops 2 (nesting depth added 10). Of this number, 23 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":"internal/agent/agent.go"},"region":{"startLine":2135}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf9a46388a32c2e365916ca4173598ce0581fddcbcdef8d1cb2f534e8f7138f5"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.formatParallelTasksAggregate (cognitive 25): agent.formatParallelTasksAggregate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, 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":"internal/agent/parallel_tasks.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"468ae3e3f6f8e15a8f05acb25efd4793a6897de2fba9d32da4f1e4afea9387a6"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.applyStormBreaker (cognitive 25): Agent.applyStormBreaker has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 4, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":3653}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e2a8af11d6e16653446c1087fc8a7af4efc93e016d32972df7d5cae634ecf0a"}},{"ruleId":"D2","level":"warning","message":{"text":"botruntime.rememberInbound (cognitive 25): botruntime.rememberInbound has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 3, 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":"internal/botruntime/runtime.go"},"region":{"startLine":513}}}],"partialFingerprints":{"codehealthFindingId/v1":"d31c7cb61e81aba58954842da60f2d81f873b30eb343f3c4e9421dafaabfa1b6"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.commitUndoTransaction (cognitive 25): Store.commitUndoTransaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, 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":"internal/checkpoint/transaction.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbbd113e3af96664844bf425384d50aefe954ee0eaa921a363f6bb7205244363"}},{"ruleId":"D2","level":"warning","message":{"text":"control.resolveInterruptedTurnStart (cognitive 25): control.resolveInterruptedTurnStart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 4, boolean chains 3 (nesting depth added 9). Of this number, 16 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":"internal/control/controller.go"},"region":{"startLine":4661}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d22d7a2f373b179499ee3717e35c97da13d4d43106ae706d08e8c77d1de31a6"}},{"ruleId":"D2","level":"warning","message":{"text":"goalMachine.restoreFromState (cognitive 25): goalMachine.restoreFromState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 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, 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":"internal/control/goal.go"},"region":{"startLine":771}}}],"partialFingerprints":{"codehealthFindingId/v1":"43ca602aa3364928249bfbe28b922451d1890e8a4c16af8b403bc7c964d9dd1e"}},{"ruleId":"D2","level":"warning","message":{"text":"Searcher.Search (cognitive 25): Searcher.Search has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 5 (nesting depth added 7). Of this number, 22 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":"internal/history/search.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"59bcbf810f38f406ba03163b05e6ebbd1db86759ab48fc75b5962f627997cb8d"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.applyInstallPluginPackage (cognitive 25): installSourceTool.applyInstallPluginPackage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, 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":"internal/installsource/plugin_package.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"d28ea8819e432b636eff75a3b9f32c0e3521f50767f23544e796fc2502db7d8d"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.archiveLocked (cognitive 25): Store.archiveLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 4, 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":"internal/memory/store.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8737274c8679ce53787e0febaed522062eb3fae692faec309b79f72dc81175a"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.appendClaudeMCPFile (cognitive 25): pluginpkg.appendClaudeMCPFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, boolean chains 4, match/switch 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":"internal/pluginpkg/claude_compat.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c51341612f76728aa94b4711ef1bf72417f26fcfe958b9e13098fea3604b1f8"}},{"ruleId":"D2","level":"warning","message":{"text":"client.buildRequestBody (cognitive 25): client.buildRequestBody has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 6, loops 2, 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":"internal/provider/responses/responses.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"194744ba57ff9d5a8ead8bd11a4af897ebfbcc7aa96d58f7dbed1cc1905cbe25"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.reviewOrEscalate (cognitive 25): Gate.reviewOrEscalate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 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":"internal/recovery/gate.go"},"region":{"startLine":927}}}],"partialFingerprints":{"codehealthFindingId/v1":"37f31093d8a7845cf1d977d64e71c5f45f7ef5da9e527b4e4046b77853d45a26"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.reconcilePreparedRepairTransaction (cognitive 25): repair.reconcilePreparedRepairTransaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 1 (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":"internal/repair/transaction.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"544c6b7df4f430cf994980e5c70bb346a033cd8b67315576526f97f5f547b7c4"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.Inspect (cognitive 25): Store.Inspect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 5, boolean chains 1 (nesting depth added 13). 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":"internal/skill/inspect.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"57e4e895801fb00ae15753408a46669ac5e41e4a3fd8bc6817b53bfd5db76966"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.validateStrictFrame (cognitive 25): extension.validateStrictFrame has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, 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":"sdk/go/wire.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e23e1bc8b77543d8efaaf843b0a50e90a077094cc45eeb27007e0eff075bc45"}},{"ruleId":"D2","level":"warning","message":{"text":"main.providerPresetViewsForRootWithResolver (cognitive 24): main.providerPresetViewsForRootWithResolver has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 6, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/settings_app.go"},"region":{"startLine":698}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fa08d62c9519b643e7ee38eaaefdb2d29525eb4b9f0eec9552828072b9cdf1d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.prependTopicsInProjectsFileOpts (cognitive 24): main.prependTopicsInProjectsFileOpts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 5 (nesting depth added 10). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 5074). 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":"desktop/tabs.go"},"region":{"startLine":5068}}}],"partialFingerprints":{"codehealthFindingId/v1":"39adc7b9f3edc15a00c1ed710d67937f06bba96cf3c5babb3769952a13b424ed"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateThemePackManifest (cognitive 24): main.validateThemePackManifest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 4, match/switch 2 (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":"desktop/theme_pack.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bf5e2e669a6213c3e74a598496212873f3fa8fdf4c1e7a0973b736f003bbe64"}},{"ruleId":"D2","level":"warning","message":{"text":"App.restoreOrBuildTabs (cognitive 24): App.restoreOrBuildTabs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, loops 4, 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":"desktop/app.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"f22179269e4577f6339839e44ac43c6ede899f09dc68cb06fb3c9239e7aca370"}},{"ruleId":"D2","level":"warning","message":{"text":"App.trashTopic (cognitive 24): App.trashTopic has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 2 (nesting depth added 7). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 7519). 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":"desktop/tabs.go"},"region":{"startLine":7512}}}],"partialFingerprints":{"codehealthFindingId/v1":"b00ec2611e1562e779b1f7c2e397002f069cc9492713ba2aa850bfa5dce284ee"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryTaskNeedleIntent (cognitive 24): agent.deliveryTaskNeedleIntent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 5, boolean chains 3 (nesting depth added 10). Of this number, 21 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":"internal/agent/agent.go"},"region":{"startLine":2424}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb9f1e880f82d27bc970e00d024405cf6ca0aee2df85a9f170884990cb7973f9"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.runToolLoop (cognitive 24): Agent.runToolLoop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 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":"internal/agent/run_loop.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"a13f97b9088230faacbf663963db974247dc17d2fb78446fddc905fdb6123a78"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.CommitRewind (cognitive 24): Store.CommitRewind has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, boolean chains 8 (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":"internal/checkpoint/transaction.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfcc55ef8981682c2f01de46978db8c75e8089f54400bedb1c705d03702f4169"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.coverageFromTurnLocked (cognitive 24): Store.coverageFromTurnLocked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1394}}}],"partialFingerprints":{"codehealthFindingId/v1":"8559e8f23d3e90d776f19a4682a8e829c3609ec796384a0a32906d30cafad4cc"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.runExportCommand (cognitive 24): chatTUI.runExportCommand has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, 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":"internal/cli/chat_tui.go"},"region":{"startLine":4966}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e22e9738f43a1b9af3add47bed9d8732f5abaf86bd227cec4901e1ac42a673a"}},{"ruleId":"D2","level":"warning","message":{"text":"config.mergeInstalledPluginPackages (cognitive 24): config.mergeInstalledPluginPackages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, loops 9, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/plugin_packages.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"771223f3190a2f0a9167a2115c773484bb5afc4fb71fe42aef995b31cc8cc120"}},{"ruleId":"D2","level":"warning","message":{"text":"control.RenderMemorySummary (cognitive 24): control.RenderMemorySummary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, loops 9, boolean chains 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":"internal/control/memory_command.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad3354aea7dbef503aa4e8f742a6b8ab98d9a064db3119676db1449ebf259200"}},{"ruleId":"D2","level":"warning","message":{"text":"turnOrchestrator.continueGoal (cognitive 24): turnOrchestrator.continueGoal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, 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":"internal/control/turn_orchestrator.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb954fb122013b4a3b101465044757cc72aa192907e28bc45505d2fc5019e968"}},{"ruleId":"D2","level":"warning","message":{"text":"turnOrchestrator.advanceGoalAfterTurn (cognitive 24): turnOrchestrator.advanceGoalAfterTurn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 3 (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":"internal/control/turn_orchestrator.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"25b6fcec6cc54b8876f8568bc97fad36970755884908cd910a151564aee56873"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.validateRequiredObject (cognitive 24): protocol.validateRequiredObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"internal/extension/protocol/validate.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"edf831239b288053184df09843f403ab3ce5f7a3efee8ca37b559f7acfeb2416"}},{"ruleId":"D2","level":"warning","message":{"text":"installlayout.publishRootEntries (cognitive 24): installlayout.publishRootEntries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 2, loops 2 (nesting depth added 10). Of this number, 15 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":"internal/installlayout/activate.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad6bfe5f376315e01331cb252b268b54b5c57350e423d7dd57c8856833403a89"}},{"ruleId":"D2","level":"warning","message":{"text":"installlayout.RetainPreviousVersions (cognitive 24): installlayout.RetainPreviousVersions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/installlayout/activate.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"558133e49892584882352d66a29cfd0e5730ab0f49f317198ae86ae2291d92d3"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.tryGitHubRepo (cognitive 24): installSourceTool.tryGitHubRepo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 5, 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":"internal/installsource/plan.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7042d65ecc0fafebf454a53f6d6de0f4d8ff73b159d5632b5935e5ec3809d10"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.List (cognitive 24): Store.List has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/memory/store.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"778c95441c42ac5f8b70119b3ae72835df5187a9cbc984bf9057a55d3692dd62"}},{"ruleId":"D2","level":"warning","message":{"text":"permission.rawBashPrefixMatches (cognitive 24): permission.rawBashPrefixMatches has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 6, loops 3, 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":"internal/permission/permission.go"},"region":{"startLine":447}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2bc8e71b4aaa4e38caf5853d070887d28249cd341245e0a9165b67626201e35"}},{"ruleId":"D2","level":"warning","message":{"text":"Package.scanSkillPath (cognitive 24): Package.scanSkillPath has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, 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":"internal/pluginpkg/pluginpkg.go"},"region":{"startLine":1099}}}],"partialFingerprints":{"codehealthFindingId/v1":"5308926240ebdd30f69cc0dfbc063b3e543fc0a033ae18e66b1278d447c06ff1"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.gitPushTaskGrantBoundary (cognitive 24): recovery.gitPushTaskGrantBoundary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 5, loops 3, match/switch 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":"internal/recovery/rules.go"},"region":{"startLine":712}}}],"partialFingerprints":{"codehealthFindingId/v1":"e41f3253ea49177be85c7035422067367ffda3e0c8dc113418f1ea1a83eac7ae"}},{"ruleId":"D2","level":"warning","message":{"text":"remote.ParseTarget (cognitive 24): remote.ParseTarget has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"internal/remote/host.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"7edaeef2a5cadfcd2083b9165f482717c2631b1d74a7f903bcbc0e444c17c46b"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.handleSession (cognitive 24): Server.handleSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"internal/remote/sshtest/sshtest.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb96216d6490234260f83bdc6c3ee70b17c183a32e893b054a0671fa838c8ee8"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.validateProviders (cognitive 24): repair.validateProviders has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, 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":"internal/repair/diagnose.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"1977e473213ac7e7f3d9d31e849066e2c569fd5f8426c78b9f719c23fbef9554"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.validateRepairChange (cognitive 24): repair.validateRepairChange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 6, 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":"internal/repair/transaction.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f2619852e88fc44327335a65a150142550b8e8a4c245de323fb0a5edd84ecaa"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.installedFileUpdateTargets (cognitive 24): repair.installedFileUpdateTargets has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, loops 4, 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":"internal/repair/update.go"},"region":{"startLine":1082}}}],"partialFingerprints":{"codehealthFindingId/v1":"bab6b9e101d9571cb3281ce677d6e6a135d3321a505047b627f38cc252491c1b"}},{"ruleId":"D2","level":"warning","message":{"text":"sandbox.consumeNullRedirect (cognitive 24): sandbox.consumeNullRedirect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 7, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/sandbox/shell.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"f83d58b15a2cb0247afcc51b6955505a7e45c245366342651c12efa565fbbc71"}},{"ruleId":"D2","level":"warning","message":{"text":"sessiontemp.cleanupStale (cognitive 24): sessiontemp.cleanupStale has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"internal/sessiontemp/manager.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e49241337663590c4168d56203172f54af3a5e4f68250ac47dbd7bff76bae91"}},{"ruleId":"D2","level":"warning","message":{"text":"FileStore.AppendAuditEvent (cognitive 24): FileStore.AppendAuditEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 3). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"534ea23395eeaae2a848b0140af3416a2d6cc9a16883cc5e476ab75347feab59"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.verifyTodoCompletionTransitions (cognitive 24): builtin.verifyTodoCompletionTransitions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 5, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/todo.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"577565e7c5990a838fe6b47fea1f8c89325629093c6cf4b88c0f53fd8998d24b"}},{"ruleId":"D2","level":"warning","message":{"text":"deleteRange.preview (cognitive 24): deleteRange.preview has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 2 (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, 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":"internal/tool/builtin/delete_range.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"4307847b1af4f2bc6b1401fd931cd71745f2ae381b972e23aea63db69c123412"}},{"ruleId":"D2","level":"warning","message":{"text":"worktree.Create (cognitive 24): worktree.Create 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":"internal/worktree/worktree.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"211db652b7cd33699dd9d019a0f73bdb9bb6f0b1fc16e46a05fe02a153cd7cfa"}},{"ruleId":"D2","level":"warning","message":{"text":"main.collectJSONLUserPrompts (cognitive 23): main.collectJSONLUserPrompts 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":"desktop/app.go"},"region":{"startLine":5030}}}],"partialFingerprints":{"codehealthFindingId/v1":"99b8f07c87005d2d9220c3d43e6e9d2ee2dc63048f0cc7270c49e8aa231e265a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.listTrashedSessionFiles (cognitive 23): main.listTrashedSessionFiles has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, 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":"desktop/sessions.go"},"region":{"startLine":503}}}],"partialFingerprints":{"codehealthFindingId/v1":"216020f7d992ff816a496b174a064379c73c6ca01ec48e4ad44056025f0c7465"}},{"ruleId":"D2","level":"warning","message":{"text":"main.mergeSessionInfos (cognitive 23): main.mergeSessionInfos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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":"desktop/tabs.go"},"region":{"startLine":9259}}}],"partialFingerprints":{"codehealthFindingId/v1":"08aa433aa31e7c81e36736307f3e71d8841c8e5aaaafbfab5ee614c37c7405d6"}},{"ruleId":"D2","level":"warning","message":{"text":"App.UpdateMCPServer (cognitive 23): App.UpdateMCPServer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 3, loops 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":"desktop/app.go"},"region":{"startLine":8991}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6fa0986068beae1b9869ddeb942bae10b7a510a1fdac3db3ad6d2da9f35bafb"}},{"ruleId":"D2","level":"warning","message":{"text":"App.keepOnlyVisibleTab (cognitive 23): App.keepOnlyVisibleTab has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 3170). 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":"desktop/tabs.go"},"region":{"startLine":3159}}}],"partialFingerprints":{"codehealthFindingId/v1":"24620125af2de1a1ea9e1c2cc8fefc44a1aa9f2c7c8323a6bde11da4780048be"}},{"ruleId":"D2","level":"warning","message":{"text":"App.RenameTopic (cognitive 23): App.RenameTopic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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":"desktop/tabs.go"},"region":{"startLine":7179}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dc4a8d21502a0251ee3aaf0f48023eeca5ff243a2b3eb5baf1049dc79beb72c"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ImportThemePack (cognitive 23): App.ImportThemePack has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_app.go"},"region":{"startLine":641}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dbb316b76a7d870ba889bc27090ce71d781aea5cd8a9ec50ded1c5225d672e9"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runInstall (cognitive 23): main.runInstall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 2 (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":"desktop/cmd/update-helper/main_linux.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"11193da5e9e5ac5583082a2fbe4fcd72dd6df724f0dd58137201a964b2061740"}},{"ruleId":"D2","level":"warning","message":{"text":"RemoteHostStore.loadLocked (cognitive 23): RemoteHostStore.loadLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 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":"desktop/remote_hosts.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a86e9fc50ec34d2c21ecf372e55c0992d1d3d6d790d0bb27c71463a24ad23b7"}},{"ruleId":"D2","level":"warning","message":{"text":"main.renderDiff (cognitive 23): main.renderDiff has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/e2ebench/diff.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"7be102d48db02c768328390e8ab96cfc2a3040a74389ac918ec7e69516385672"}},{"ruleId":"D2","level":"warning","message":{"text":"main.parseNewTests (cognitive 23): main.parseNewTests has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, 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/e2ebench/diff.go"},"region":{"startLine":503}}}],"partialFingerprints":{"codehealthFindingId/v1":"5933daa9b2307e71e81a7a2e22ef7cb3613b7da9cdb6cdbaba82e4ef21afafad"}},{"ruleId":"D2","level":"warning","message":{"text":"main.migrateWithRelaunch (cognitive 23): main.migrateWithRelaunch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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":"cmd/reasonix-legacy-migrator/main.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccbbb8c44c30f26aa4cd45da4336d75c70aa1301ae2cb02bf4b569eb8a6f1964"}},{"ruleId":"D2","level":"warning","message":{"text":"main.parseWorkflow (cognitive 23): main.parseWorkflow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 3, 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":"cmd/signpath-contract/main.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c96aa0474c522d8b32d9b3e9982ee8157c438e74bcd0377f51f1a233e1c84bb"}},{"ruleId":"D2","level":"warning","message":{"text":"service.sessionDelete (cognitive 23): service.sessionDelete has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/acp/service.go"},"region":{"startLine":2064}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c8c8b4ef3e378ff57c99169a107ae9c9a4fb69431fe7896fa42d8f8548a0327"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ListSessionOrder (cognitive 23): agent.ListSessionOrder has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, loops 1 (nesting depth added 10). 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 into named stages: move each independent 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":"internal/agent/save.go"},"region":{"startLine":1885}}}],"partialFingerprints":{"codehealthFindingId/v1":"33b7c57c224575370b46c7d1a125dc08aa2b881cf575399920a9bc451dd311fa"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.renderRecoveryText (cognitive 23): bot.renderRecoveryText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/render.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"f22d904a355001c78af457945da791f8c946201c9f5d521fb4173ef56076c87d"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.mergeRuntimeHost (cognitive 23): capdiag.mergeRuntimeHost has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 7, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/capdiag/collect.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a7c90a813ad25f96769d6acdb7db927ee802fed3c8851e85054852d9b9e2d75"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.approvalChoiceLabels (cognitive 23): cli.approvalChoiceLabels has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 5, loops 1 (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":"internal/cli/chat_tui.go"},"region":{"startLine":3099}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf5f764ebe367ff3deced78d46204ca95b72b0c553d654252d20a1f3c6630df0"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.resolveSessionQuery (cognitive 23): cli.resolveSessionQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/cli_flags.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"28740ab4191e5e4f1353ab021bbcaeffdf64fbb853f9e271d0c86541e0e1be46"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.pluginDoctorCommand (cognitive 23): cli.pluginDoctorCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 3 (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":"internal/cli/plugin.go"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d76d9d29023f09bd076b79498b17ba70c0f74db967d612a2f8f99f754e254df"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.selectedCopyText (cognitive 23): cli.selectedCopyText has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 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":"internal/cli/transcript.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"966b54a561dd062191788f3df49319f627e58c01b20e6a59a8df9cedbee2969e"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.runMCPSubcommand (cognitive 23): chatTUI.runMCPSubcommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":5097}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ebd5a20230a71c0d92d831837daffdad2330b4e6d67e39a8e738fff987cc03b"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.skillSaveEnabledChanges (cognitive 23): chatTUI.skillSaveEnabledChanges has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (nesting depth added 5). Of this number, 15 points are the body\u0027s own statements and 8 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, 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":"internal/cli/skill_hooks.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"d692e8d38d372ded1ce67ae5b2b4c36853b914786288cc8454ef3794080b584a"}},{"ruleId":"D2","level":"warning","message":{"text":"config.RemovePluginFromSourcesForRoot (cognitive 23): config.RemovePluginFromSourcesForRoot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, loops 2 (nesting depth added 3). 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, 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":"internal/config/edit.go"},"region":{"startLine":1416}}}],"partialFingerprints":{"codehealthFindingId/v1":"f70ea003e514047571358ad6139a0215bfd9093a7ae52c3afb56ae0968f86911"}},{"ruleId":"D2","level":"warning","message":{"text":"config.lockConfigFilesEdits (cognitive 23): config.lockConfigFilesEdits has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 10 (nesting depth added 10). 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 into named stages: move each independent 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":"internal/config/mutate.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f23b8932af993447933f619132f03823c70cad3f55dfa95eb29d7ee9632862c"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.Collect (cognitive 23): doctor.Collect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 4, loops 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":"internal/doctor/report.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"95987bcb8148fd2d8a49d5487e3e34ac7dc21bf99298f3e0b20deb862ed88ba9"}},{"ruleId":"D2","level":"warning","message":{"text":"eventwire.ToWire (cognitive 23): eventwire.ToWire has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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":"internal/eventwire/wire.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"25c6d1e1aabf4fdfee9c8c36d73c6981acec1643e4f4ddde56e75098c39de12c"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.NormalizeSerialTodos (cognitive 23): evidence.NormalizeSerialTodos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 6, 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":"internal/evidence/evidence.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"d58e84bf214766e4a1b6d9cdcfa39f94deaa603b252deb896b4be9b4bbb170fb"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.resolveContributions (cognitive 23): extension.resolveContributions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (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":"internal/extension/builder.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7e4d91d75a1089c64f9aa7298205e35f0382ced9076efab8c15caa49ec86a85"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.buildJSONSchema (cognitive 23): protocol.buildJSONSchema has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/extension/protocol/schema.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"631127a5beb6e4f3f19b6fc103dff74b935d087889b4f58c46c293854e4c2328"}},{"ruleId":"D2","level":"warning","message":{"text":"installsource.copyDir (cognitive 23): installsource.copyDir has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to one function literal inside it that branches (line 326). 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":"internal/installsource/skill.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f7c0347f05d284cfa960c87177647d0c7e2f9229076840932478e7ff37c4a79"}},{"ruleId":"D2","level":"warning","message":{"text":"permission.hasAnyFoldedArg (cognitive 23): permission.hasAnyFoldedArg has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 5, loops 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":"internal/permission/bash_approval.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"85261802c6240abdec7f8ab7badb39dd5bbe6b09e76f18bac7ef3128bc10133e"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.Check (cognitive 23): Gate.Check has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/permission/permission.go"},"region":{"startLine":701}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b16928a2428f9f7b9d05e9d9e4457f656811a2f14cb09538f0f647ebcaaf6e3"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.normalizeIdentityURL (cognitive 23): plugin.normalizeIdentityURL has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 6, 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":"internal/plugin/security.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5b4d62dcb77aafc4a80d0e5fa8aa7070530ff09e9e56920c7e9ddbd305851af"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.parseNativeV1 (cognitive 23): pluginpkg.parseNativeV1 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, boolean chains 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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7b8de16aafb4e4748eaa67e0b186df4b5491c5451f4f4b77a0159100431df05"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.normalizeMessages (cognitive 23): provider.normalizeMessages 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":"internal/provider/provider.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b7fc74bdfb57a6394d3c59a18f3382bbc7b20e146708e1d01b679fc48efa74e"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.backfillToolCallNames (cognitive 23): provider.backfillToolCallNames has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 6, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/provider/provider.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"96c3edc5b363b2863d528537b78a501b8304b8f9b1a92a53661d9dc62ccafe1b"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.snapshotLocked (cognitive 23): Gate.snapshotLocked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, loops 3 (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":"internal/recovery/gate.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"b69dc1b221f5ca539cfb372cfc3045916de6444befb242b2fc7d9456a6107d5b"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.Resolve (cognitive 23): Gate.Resolve has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, match/switch 3, 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":"internal/recovery/gate.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"69ce29c4396f30acfce6dcef5ec2799c674687dd5a8b28bf0285c7eafaab79cf"}},{"ruleId":"D2","level":"warning","message":{"text":"remote.buildAuthMethods (cognitive 23): remote.buildAuthMethods has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 3, 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":"internal/remote/auth.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba9289a3e5f565abd45ee8608a385bc5d11a80f302c838a82e2b648e92627a25"}},{"ruleId":"D2","level":"warning","message":{"text":"remote.identityPublicKeys (cognitive 23): remote.identityPublicKeys has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, 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":"internal/remote/auth.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a80cc034d371b07d87951b3ba356fef8580b54484ea70de17081ad4505d725b"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.ArchiveSupersededPendingFileUpdate (cognitive 23): repair.ArchiveSupersededPendingFileUpdate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, loops 1 (nesting depth added 7). 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, split the body into named stages: move each independent 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":"internal/repair/update_legacy.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef3fe44ec8def0329c171cc5d4aa5b2e2ac3befd2028667149cdc88d306b8bf2"}},{"ruleId":"D2","level":"warning","message":{"text":"TmuxAdapter.Attach (cognitive 23): TmuxAdapter.Attach has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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":"internal/taskmonitor/tmux.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7b476a5e16b4e9f3241ae592652658a396c06e6066b68518b98bb54597d9a20"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.verifyTodoStep (cognitive 23): builtin.verifyTodoStep has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/completestep.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfbb24332d54a8163c6292737a1c19f619e73c36b4f54e15fda2bdf7d58540fd"}},{"ruleId":"D2","level":"warning","message":{"text":"globTool.globRecursive (cognitive 23): globTool.globRecursive has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 1 (nesting depth added 4). Of this number, 13 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \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":"internal/tool/builtin/glob.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"c61cc9ef212f8f4980fb3e84833bb952edc7370326dfeea49a4664a2920ac436"}},{"ruleId":"D2","level":"warning","message":{"text":"server.pumpStream (cognitive 23): server.pumpStream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, match/switch 4, boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"sdk/go/sdk.go"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dc9c231c1018442c02e162d7d41afa8a34ce58404c22e6fb1de2bcf1c2ae81d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateRemoteHostEntry (cognitive 22): main.validateRemoteHostEntry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/remote_hosts.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"89f5316c1c8374312b2bc70a3344efdd09a158640c30702ff8a6a4a0945460c4"}},{"ruleId":"D2","level":"warning","message":{"text":"main.prepareSessionTrashTarget (cognitive 22): main.prepareSessionTrashTarget has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"desktop/sessions.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"b05b1092faf7db02813d041c3a209b42aa5792d5f6b2b2565fdf99da70f05caf"}},{"ruleId":"D2","level":"warning","message":{"text":"main.restoreSessionTopicIndex (cognitive 22): main.restoreSessionTopicIndex has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 3 (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, 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":"desktop/tabs.go"},"region":{"startLine":6905}}}],"partialFingerprints":{"codehealthFindingId/v1":"43bcb3aa3e03ba2bf0c47b6b6c600e656a4d870e1bb5de23ee2948e318dba7cc"}},{"ruleId":"D2","level":"warning","message":{"text":"main.writeThemeStaging (cognitive 22): main.writeThemeStaging has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 1 (nesting depth added 4). Of this number, 15 points are the body\u0027s own statements and 7 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_store.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ae779b30d4ef74cf5f8dc19902bbd6529cd2d8cca3e2f413dce25d03b18a5c0"}},{"ruleId":"D2","level":"warning","message":{"text":"App.CheckpointsForTab (cognitive 22): App.CheckpointsForTab has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 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":"desktop/app.go"},"region":{"startLine":2582}}}],"partialFingerprints":{"codehealthFindingId/v1":"41e1636017bd4ffba82ff85bbaa0373ecaf224a7bb0b97275fd3c65ec8d69cf6"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ensureProviderAccessForKey (cognitive 22): App.ensureProviderAccessForKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 2 (nesting depth added 7). Of this number, 20 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":"desktop/settings_app.go"},"region":{"startLine":3179}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e9f22370e44bbfe677c0d3c0670633880cead78173406600011795cee3af7c3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ContextPanel (cognitive 22): App.ContextPanel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 5, 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":"desktop/tabs.go"},"region":{"startLine":8120}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f9582cff4a7587c9107379c2a7d28747abde10ea8451065e35aee9f0c38f76f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.discoverTopLevelSigningWorkflows (cognitive 22): main.discoverTopLevelSigningWorkflows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 1 (nesting depth added 7). Of this number, 15 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":"cmd/signpath-contract/main.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9cc33edcda0c70b2ae5e5c918c108d7de60a63677e4a07bfa70ad2b826724aa"}},{"ruleId":"D2","level":"warning","message":{"text":"acp.enrichStateWithExtensionModels (cognitive 22): acp.enrichStateWithExtensionModels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/acp/extension_models.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc97a5565d2922e8f6c3c2d15bb14077665bbc000a826f854f49f22472e8dfa2"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.probeSessionEventHeader (cognitive 22): agent.probeSessionEventHeader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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":"internal/agent/session_events.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c23e5cf92585e549dd7e101e9b064a786678abbf395f1c09b76d6ef651c18e8"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.compact (cognitive 22): Agent.compact has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"internal/agent/compact.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"53e1cf75c8c13de80aea0dbddd8afb20424ebb2cd42e8dd912ae6fb35e003ce1"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.pruneBlobsLocked (cognitive 22): Store.pruneBlobsLocked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, loops 10, boolean chains 1 (nesting depth added 9). Of this number, 21 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":734}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e5de4ebef0e2cb4481b4ce3e35a3ce5bbe663b493ddccb1cd3e7c0ff2397a5c"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.TruncateFrom (cognitive 22): Store.TruncateFrom has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, loops 8, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/checkpoint/checkpoint.go"},"region":{"startLine":933}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a1455740c8c1f7a5f7bd87620d6106e9f738b855f76a47a2441aa1b8ac7e0cb"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.Run (cognitive 22): cli.Run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 5, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/cli.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"72d6b194cd852d10c3d09a6c37238fe7660ebe899a71f4f191c4aebc60cb9ff2"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.appendEnv (cognitive 22): cli.appendEnv has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 5, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/cli.go"},"region":{"startLine":2288}}}],"partialFingerprints":{"codehealthFindingId/v1":"940bf3873bb341377322c035782c8b17d070d5d6f79693a57124c85bc239facd"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.doctorCapabilitiesCommand (cognitive 22): cli.doctorCapabilitiesCommand 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":"internal/cli/doctor_capabilities.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc77dbe217fd900b24b2c4c31bcd28804cffa525b79ed64266c472688a02c614"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.normalizeMath (cognitive 22): cli.normalizeMath has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 6, match/switch 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":"internal/cli/latex.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"4971643f3f2125d59f4a10d6ec5153efacb43cfa20cf1c0c9dc9690da33ace26"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.parseSessionMachineOptions (cognitive 22): cli.parseSessionMachineOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 5, 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":"internal/cli/session_machine.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f2a050bcc5f8c88f940e03ac4eebc53b555f3da8a61d478acafac9dc04cf7cb"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleChooserKey (cognitive 22): chatTUI.handleChooserKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, match/switch 4, boolean chains 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":"internal/cli/chooser.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2a422f9af1eeb3d1a28eddf8c5f96fc95146e4b0b147df3a8403d00ce1b3fb9"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.runEffortCommand (cognitive 22): chatTUI.runEffortCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1 (nesting depth added 2). Of this number, 13 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \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":"internal/cli/effort.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"69c224a230f100f7dd2fe18acba83a89e205f7c4cf0bd687ed05272402a13e8e"}},{"ruleId":"D2","level":"warning","message":{"text":"quickPicker.handleKey (cognitive 22): quickPicker.handleKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, match/switch 3, boolean chains 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":"internal/cli/quick_picker.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"0091f9adc52bb786684a0d24305256819509c1561862540fb8792e836436e454"}},{"ruleId":"D2","level":"warning","message":{"text":"config.mergeTOMLProviders (cognitive 22): config.mergeTOMLProviders has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, 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":"internal/config/load.go"},"region":{"startLine":504}}}],"partialFingerprints":{"codehealthFindingId/v1":"37aabce7e7b7ae0e5e53e75bed8205a125c7a1f70ee6ee425d1beb47a68a858a"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.ClearSession (cognitive 22): Controller.ClearSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1 (nesting depth added 7). Of this number, 14 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":"internal/control/controller.go"},"region":{"startLine":3233}}}],"partialFingerprints":{"codehealthFindingId/v1":"12c590e684248791e8733537fa3d7895c2a72da2ef4900355f16730f5bbd7e6d"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.hasFailedCompleteStepRecoveryForTodo (cognitive 22): evidence.hasFailedCompleteStepRecoveryForTodo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 4, 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":"internal/evidence/evidence.go"},"region":{"startLine":1416}}}],"partialFingerprints":{"codehealthFindingId/v1":"81ea3727d2670a45003a3b301375758bc6ac48328a883ea80843e7e22663005e"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.PathsProvenInSession (cognitive 22): evidence.PathsProvenInSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/evidence.go"},"region":{"startLine":1546}}}],"partialFingerprints":{"codehealthFindingId/v1":"d48b41ff4e86a99e8a63455b57ca161b0578988f30752d993fbc3654b247f204"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.BashToolCallUsesOpaqueInlineInterpreter (cognitive 22): evidence.BashToolCallUsesOpaqueInlineInterpreter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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":"internal/evidence/evidence.go"},"region":{"startLine":1726}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c5863790411ee24319b80719e9df7664547cb9d638bea20fe586b4d88d202c9"}},{"ruleId":"D2","level":"warning","message":{"text":"Ledger.HasSuccessfulDeliverySignoffAfter (cognitive 22): Ledger.HasSuccessfulDeliverySignoffAfter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 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":"internal/evidence/evidence.go"},"region":{"startLine":809}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaa9f9ee7a0fd5d2bc451308e66c3f66a4bf4ecb9cf77104e9291c0e4f40f36b"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.validateTag (cognitive 22): protocol.validateTag has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, 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":"internal/extension/protocol/validate.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"59111af344c21f6ec032bba8906f1199780385e082340abaaf016454d16750c9"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.Run (cognitive 22): hook.Run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/hook/hook.go"},"region":{"startLine":1145}}}],"partialFingerprints":{"codehealthFindingId/v1":"cee66e75aa8d9ebfe4e442740192931d5d9d0aa9f044983d8d3674fca7d8f1e8"}},{"ruleId":"D2","level":"warning","message":{"text":"installsource.parseMCPJSON (cognitive 22): installsource.parseMCPJSON has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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":"internal/installsource/mcp.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a1d3f0c4fb79ed35fea0a407522730984c449876eae0cc2905be07245784b3e"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.Execute (cognitive 22): installSourceTool.Execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/installsource/install_source.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"55765fde21373f9a4ff4460562d7ca8597c4a5d5d78118ed4e4700c2949bf2a8"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.AutoRecall (cognitive 22): memory.AutoRecall has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 3 (nesting depth added 5). Of this number, 20 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":"internal/memory/auto_recall.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"b46518276668731d9eba5b575976a916461ff2a3ef1fa1d9011d9aebbdb32842"}},{"ruleId":"D2","level":"warning","message":{"text":"sandbox.normalizeNullRedirects (cognitive 22): sandbox.normalizeNullRedirects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, 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":"internal/sandbox/shell.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb07377e2b21fd01ce17a7b5b3ed0adc534623b33e511513f112b17a2714829e"}},{"ruleId":"D2","level":"warning","message":{"text":"main.channelSessionRoutesForDir (cognitive 21): main.channelSessionRoutesForDir has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, loops 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":"desktop/app.go"},"region":{"startLine":3286}}}],"partialFingerprints":{"codehealthFindingId/v1":"d91ba7a6c3cd216e1c28cfa969f4fe954da843ad5d0f65f9d184fa42c92fc30c"}},{"ruleId":"D2","level":"warning","message":{"text":"main.canonicalRemoteSSHHost (cognitive 21): main.canonicalRemoteSSHHost has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/remote_hosts.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"f967aef7974a2b98dc8f009aaddfdd4ac6da4e534937135c4ef9de5db90eb6af"}},{"ruleId":"D2","level":"warning","message":{"text":"main.desktopBotConfigConfigured (cognitive 21): main.desktopBotConfigConfigured has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 6. 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":"desktop/settings_app.go"},"region":{"startLine":1595}}}],"partialFingerprints":{"codehealthFindingId/v1":"21acc899938c5f4dc53bcb5448f5cf2874541a898a9563a57b34b7a4dd1281b6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.downloadInto (cognitive 21): main.downloadInto has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, 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":"desktop/updater.go"},"region":{"startLine":914}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e9aada02f94d1d56a83755945fcb194d06cb1c8cc9fbabb47620cee1e3f1518"}},{"ruleId":"D2","level":"warning","message":{"text":"main.extractLinuxReleaseUnit (cognitive 21): main.extractLinuxReleaseUnit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/updater.go"},"region":{"startLine":1034}}}],"partialFingerprints":{"codehealthFindingId/v1":"11d8b0015fd43755ba9bc6b581b4464f186c99bfe696d77900d9c70fdbe7a3ab"}},{"ruleId":"D2","level":"warning","message":{"text":"App.clearActiveSessionRuntime (cognitive 21): App.clearActiveSessionRuntime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"desktop/app.go"},"region":{"startLine":2343}}}],"partialFingerprints":{"codehealthFindingId/v1":"950ccb24f8b95338857bf6201fb32f01a71418e2ead4945821526b1bd981d286"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SetMCPServerEnabled (cognitive 21): App.SetMCPServerEnabled has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (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":"desktop/app.go"},"region":{"startLine":9209}}}],"partialFingerprints":{"codehealthFindingId/v1":"b769b1a63050aee125d549a0fcdc80a95ed0fb9a365154b73f98c68a728425a5"}},{"ruleId":"D2","level":"warning","message":{"text":"App.tabSessionMetaSnapshotForCurrentSession (cognitive 21): App.tabSessionMetaSnapshotForCurrentSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 3 (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":"desktop/tabs.go"},"region":{"startLine":8723}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dcbd35ec95f7f09d15e42641ae90e10e2ff4cc096ac4eb106545b3cfb5ae460"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 21): main.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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":"cmd/e2ebench/main.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"18e039d9f23d64e37a3c440845646cc3884e965bdcf2931c733071f0f81be74f"}},{"ruleId":"D2","level":"warning","message":{"text":"updateSink.Emit (cognitive 21): updateSink.Emit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/acp/dispatch.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f53f485368c76d4b79c6527a4eb2d53720e194754ab0261c83e3b61d9bb3405"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryMutationRunesNegated (cognitive 21): agent.deliveryMutationRunesNegated has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/agent.go"},"region":{"startLine":2498}}}],"partialFingerprints":{"codehealthFindingId/v1":"b34e8fd8bd7467ca738c5055e31263ef0dfff4f554148a2a396242a0c5d71250"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.formatFleetAggregate (cognitive 21): agent.formatFleetAggregate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, 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":"internal/agent/fleet.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"35a3873bfa9748aef53febb44d54a3f37648e1fbedcc4d6d354e0dc02d347cdf"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ReclaimableRecoveryBranches (cognitive 21): agent.ReclaimableRecoveryBranches has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"internal/agent/recovery_gc.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"975767a7858b46fd2bb9682d8f148d8076f343c3d66a15e8be3c1d5756095f67"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ReadOnlySubagentToolRegistryForDepthWithRuntime (cognitive 21): agent.ReadOnlySubagentToolRegistryForDepthWithRuntime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 2, loops 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":"internal/agent/task.go"},"region":{"startLine":1574}}}],"partialFingerprints":{"codehealthFindingId/v1":"708318d089c85e823c0b0ee2bf5b03f003b54d7eb14fdb372684157aa252c2fc"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.RunSubAgentWithSession (cognitive 21): agent.RunSubAgentWithSession has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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":"internal/agent/task.go"},"region":{"startLine":1873}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d9781723b61f33bda5f35eefc7e2792cd94f1964e63be3201ac228ce83cf9a0"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.observeBeforeMutation (cognitive 21): Agent.observeBeforeMutation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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":"internal/agent/execute_one.go"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"8888034eced7090ec75fcc231b83e1dc85a04c3ddac7b0e47b26bac390f1cdd4"}},{"ruleId":"D2","level":"warning","message":{"text":"MockProvider.Stream (cognitive 21): MockProvider.Stream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, match/switch 2 (nesting depth added 7). Of this number, 16 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/testutil/mock_provider.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"91484e5384207e47d6008917ab4fcdf3138c57fffbf9e7ecd78aaa6368a4c0a9"}},{"ruleId":"D2","level":"warning","message":{"text":"adapter.parsePostContent (cognitive 21): adapter.parsePostContent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, match/switch 7, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/feishu/inbound.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"98b9ef0ea57a75bc4afde41e2508e7f12233d80036922593b125d2121b5d21b2"}},{"ruleId":"D2","level":"warning","message":{"text":"weixin.Login (cognitive 21): weixin.Login has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, match/switch 5, 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":"internal/bot/weixin/weixin_login.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b81ecb87dbb87c7cba74c5ebc1a25c16b5ad167227843d9b07a4d4466df6c4c"}},{"ruleId":"D2","level":"warning","message":{"text":"botruntime.AdapterBindings (cognitive 21): botruntime.AdapterBindings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 5, match/switch 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":"internal/botruntime/runtime.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b4c0aaff909ec2cc669ecc4b75bf2019bd31ee6ca45407e1f3d67344f9621bf"}},{"ruleId":"D2","level":"warning","message":{"text":"Ledger.CheckFinalGate (cognitive 21): Ledger.CheckFinalGate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, match/switch 8, 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":"internal/capability/ledger.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e4a2c4960347195c24ff9b8dbb9ff39bd617e4fbafb1724dc79e08c45b34d55"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.redactAbsolutePaths (cognitive 21): capdiag.redactAbsolutePaths has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 7, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/capdiag/collect.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"2beeeacc8e6dc99b290af9c6396e9d183f342ba60f4e9396030aaf26a800c63b"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.CommitRewindWithForward (cognitive 21): Store.CommitRewindWithForward 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":"internal/checkpoint/transaction.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"765a287a02068c3459991203e6597590d9701b09ef34ef25dec499db214e6c0b"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.precheckFiles (cognitive 21): Store.precheckFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1294}}}],"partialFingerprints":{"codehealthFindingId/v1":"05f5f109f578dd494da3c8b24c489a43179379da571a4e4479f7a01ab690608c"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.PrepareFileRevert (cognitive 21): Store.PrepareFileRevert has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1531}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a6f9d6aacd58d09e40503a9e70802a42c9fc7c4637e4fe5bdabed173325c19b"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.activeAtToken (cognitive 21): cli.activeAtToken has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, 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":"internal/cli/complete.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"662c899143dd55213979ce8b6bd39de8d23cc13220b767e636a37f9fb4ee90e8"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.doctorRepairCommand (cognitive 21): cli.doctorRepairCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, 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":"internal/cli/doctor.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"761aba23b43af9835929cb697ac411d3373098e8af0edebf63d66bb56d72fb86"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.doctorSessionCommand (cognitive 21): cli.doctorSessionCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"internal/cli/doctor.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"32395ea4e01ff6f18a99deab0ae13254982e97a81576e6cffd5a51e24c5642e6"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.readAtom (cognitive 21): cli.readAtom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, loops 6, match/switch 4, 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":"internal/cli/latex.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb5d53f04fe6c86a39831e153836217dc55467b51fc174f8919aab28c70dd2eb"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.mcpInstallWithClient (cognitive 21): cli.mcpInstallWithClient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 2, match/switch 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":"internal/cli/mcp.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ccc3341a8ebea6ae41606ecb41427dc3157f2d2211ee218a7372915b9f941e3"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.subagentListCommand (cognitive 21): cli.subagentListCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"internal/cli/subagent.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"854cdcc9280dd20363b891325fa496276aaa58be3d46489393b09c20d7d6d733"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.subagentEditCommand (cognitive 21): cli.subagentEditCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"internal/cli/subagent.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"57c208b87a54128cfaa28ddc57dc02bed48c0f4ae0082010a6efbf29880adc68"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.toggleShellOutput (cognitive 21): chatTUI.toggleShellOutput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 6, 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":"internal/cli/chat_tui.go"},"region":{"startLine":2814}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc196e15bf7e37f4bf5c14ab83d9c0cab6398e2bfd6adf58de80230bad963e0d"}},{"ruleId":"D2","level":"warning","message":{"text":"providerSetupSession.addProviderAccess (cognitive 21): providerSetupSession.addProviderAccess has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 5, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/setup_manager.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"460c2e7ddfcea8ae38454e8731dd0805df76e6cf259046938770252e092b463f"}},{"ruleId":"D2","level":"warning","message":{"text":"config.backfillDeepSeekPro (cognitive 21): config.backfillDeepSeekPro has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 4, match/switch 3, 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":"internal/config/load.go"},"region":{"startLine":342}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4bcfe54c9a2379df2722fdbc67e8cdcf1cbac79c50a79320e31e1b06893eaca"}},{"ruleId":"D2","level":"warning","message":{"text":"config.mergeTOMLProviderAccess (cognitive 21): config.mergeTOMLProviderAccess has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 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":"internal/config/load.go"},"region":{"startLine":564}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc63a49cf5c09ddd132b76dbdebda2304acb15521350786f121cd9704fdc91eb"}},{"ruleId":"D2","level":"warning","message":{"text":"control.explainError (cognitive 21): control.explainError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, 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":"internal/control/errmsg.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"53026faa9cbecf31c6d2f5ef66ac268de8023bdab6c2701e8d20f2bdad2f287e"}},{"ruleId":"D2","level":"warning","message":{"text":"control.plannerDirectiveText (cognitive 21): control.plannerDirectiveText has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 4, 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":"internal/control/planner_gate.go"},"region":{"startLine":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"f24be1e8e4fc09fa9a037e09f57238ab460d527fc7460718b887c7dc7061d3a7"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.recoverSnapshotConflict (cognitive 21): Controller.recoverSnapshotConflict has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/controller.go"},"region":{"startLine":4214}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bd9021dd43e7e82f5be336bc0bf73d84b2080316f48b5657c9b9a92c464b437"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.composeWithGoal (cognitive 21): Controller.composeWithGoal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"internal/control/input.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf0b779d44441ead12c216734ab1c40f0d3d66c49e22733df86731d7bc69847e"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.detectRefsMode (cognitive 21): Controller.detectRefsMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"internal/control/refs.go"},"region":{"startLine":506}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2b37ac63f6eac8d94d3fd563175c201d5d8d45c5a2d2e1aaef8d0e00c37d72e"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.summarizeQualityTranscript (cognitive 21): doctor.summarizeQualityTranscript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 2, boolean chains 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":"internal/doctor/quality.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b676dcfde7d282fac30bf4050b2a8da0bbe379fb1174a416a56349aa9b85828"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.receiptsReviewChanges (cognitive 21): evidence.receiptsReviewChanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, 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":"internal/evidence/evidence.go"},"region":{"startLine":947}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ba196017b15fface5d9ae8de06197a0a9e5e14d4250c7506fe686f58bb19776"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.bashReadOnlyCommandWrites (cognitive 21): evidence.bashReadOnlyCommandWrites has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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":"internal/evidence/evidence.go"},"region":{"startLine":2176}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8cd9e81bef5a0faaccad0752f5cdd6e6e2e8ec2cded0d7240fec45ed0255070"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.Contributions (cognitive 21): Manager.Contributions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 9 (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":"internal/extension/sidecar/manager.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9c6d9dd0efa6746bcf220f7c36f7ba216d02f71a339c4351e38e252b222993d"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.appendPluginInspect (cognitive 21): hook.appendPluginInspect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 8 (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":"internal/hook/inspect.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7cfdea75eaaabfb45434aed125cf64debcf494c1429079d41daef6409e217f2"}},{"ruleId":"D2","level":"warning","message":{"text":"installsource.scanSkillRoot (cognitive 21): installsource.scanSkillRoot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 232). 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":"internal/installsource/skill.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a34a8aeacefb23ee90570b08766f822957effe4de3289b964063e4e06356580"}},{"ruleId":"D2","level":"warning","message":{"text":"instruction.Resolve (cognitive 21): instruction.Resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 16 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/instruction/resolver.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f201d481423fe8ed540e84dcf60570a9ffa5f22986bc26a1d2f4972081a88f0"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.recallMemories (cognitive 21): memory.recallMemories has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, loops 9, 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":"internal/memory/auto_recall.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"70b609a5e671527098871d6a81429e51aa019274926b59987fc1db92f9cc8775"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.ListAll (cognitive 21): Store.ListAll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 2 (nesting depth added 9). Of this number, 19 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":"internal/memory/store.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"dec92d02c0d275007eca74aa4e3c36db49857dee9d01957efe6633a330c18b7f"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.launcherLocatorForSpec (cognitive 21): plugin.launcherLocatorForSpec has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 3, 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":"internal/plugin/launcher_lock.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eb444dfabb9e03a5567cf385a4853738c955e7ad6949b7ec52706158c942587"}},{"ruleId":"D2","level":"warning","message":{"text":"productdocs.parseDocumentWithParser (cognitive 21): productdocs.parseDocumentWithParser has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 2 (nesting depth added 6). 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, split the body into named stages: move each independent 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":"internal/productdocs/docs.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b3c47210d0ce1b30f8b4842eb50a2c9fbe14b4570d829c34b52780aef4da157"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.askHuman (cognitive 21): Gate.askHuman has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 6, 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, 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":"internal/recovery/gate.go"},"region":{"startLine":1011}}}],"partialFingerprints":{"codehealthFindingId/v1":"22661798aa966d0459c179e0eac2ce9a21bff45a1e9033e29e327aa4af41d51a"}},{"ruleId":"D2","level":"warning","message":{"text":"HostKeyPolicy.HostKeyAlgorithms (cognitive 21): HostKeyPolicy.HostKeyAlgorithms has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 3, match/switch 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":"internal/remote/knownhosts.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b315a932b1282c020a8cf7623f09b5fdce60ed541de34649e8045c56c4ef389"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.RecoverFailedInstall (cognitive 21): repair.RecoverFailedInstall has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 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":"internal/repair/apply_failure.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c1750b02684b5e9646b82ffc2bd97086bdf966468d1c612fc1f0992f5cad55e"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.validateSupersededPendingFileUpdate (cognitive 21): repair.validateSupersededPendingFileUpdate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 2 (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":"internal/repair/update_legacy.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"58c52d2c662f8ff766661b009e6875c9fc39062471869b7bcbd66b926fe6640a"}},{"ruleId":"D2","level":"warning","message":{"text":"FileStore.RecordIdempotency (cognitive 21): FileStore.RecordIdempotency has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":693}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6b8071c622e36c76a51bf2aca6b4f8e67497f14d39284a1f82822f0d6d54aa0"}},{"ruleId":"D2","level":"warning","message":{"text":"bash.prepareLaunch (cognitive 21): bash.prepareLaunch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"internal/tool/builtin/bash.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"eced1c3eac656821e557e05ac6305f0ae22100046802a1fa419a7ec5a95febab"}},{"ruleId":"D2","level":"warning","message":{"text":"completeStep.Execute (cognitive 21): completeStep.Execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, 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":"internal/tool/builtin/completestep.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"2734c505ac916c6e00163e80200f711add66d35932e18e4cda7c1d29f757c431"}},{"ruleId":"D2","level":"warning","message":{"text":"main.removeEnvFile (cognitive 20): main.removeEnvFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/dotenv.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8139b18a800130a4a3d7fbe7089e86c4157ce9f17078234d303aa56f737699f6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateSessionTrashTarget (cognitive 20): main.validateSessionTrashTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"desktop/sessions.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"d95957be8d754837b50cbf66c664c5313ebe7fb3ec54383d93399ba59ec49c13"}},{"ruleId":"D2","level":"warning","message":{"text":"App.mcpControllersSharingHost (cognitive 20): App.mcpControllersSharingHost has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 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":"desktop/app.go"},"region":{"startLine":7890}}}],"partialFingerprints":{"codehealthFindingId/v1":"47d3b5a354ae6bb0404a2b5e53e2781450fa2646ac77bae62b403c835f141b0a"}},{"ruleId":"D2","level":"warning","message":{"text":"App.AddProviderPresetAccess (cognitive 20): App.AddProviderPresetAccess has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 5). Of this number, 16 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":"desktop/settings_app.go"},"region":{"startLine":2606}}}],"partialFingerprints":{"codehealthFindingId/v1":"69d828a48579ca4539afe1b06875ea6ca20c30dceffc4759f0c04b43efbb01fe"}},{"ruleId":"D2","level":"warning","message":{"text":"App.reapOrphanCodeGraph (cognitive 20): App.reapOrphanCodeGraph has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 3, 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":"desktop/shared_host.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"da68091df9082a595e856514654fcc688a611e7065cc7c4cc03b2125f33fe082"}},{"ruleId":"D2","level":"warning","message":{"text":"main.changedLineSet (cognitive 20): main.changedLineSet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 5, boolean chains 2, 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":"cmd/e2ebench/diff.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"721d52b97710ed0eeefeb90a6663b42fd1f339c75176dd55992d7df153998375"}},{"ruleId":"D2","level":"warning","message":{"text":"service.switchSessionConfig (cognitive 20): service.switchSessionConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 3 (nesting depth added 6). Of this number, 14 points are the body\u0027s own statements and 6 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":"internal/acp/service.go"},"region":{"startLine":1592}}}],"partialFingerprints":{"codehealthFindingId/v1":"a814dc1014611c4f20ba009b8a8424a5328bb14dd5609e4b0f7e30fc1be9f78d"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ListBranches (cognitive 20): agent.ListBranches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, loops 1 (nesting depth added 8). 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":"internal/agent/branch.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebd994b70ed7451523843bc7ca1e3608317d8d557142b25da9c5c5beabebc9b8"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.reconcileRecoveryTrashStage (cognitive 20): agent.reconcileRecoveryTrashStage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/recovery_gc.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bbdef8dc7eef66d3edecc5db797cca07be47e83eca375229231c1a725b56b6b"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.formatDesktopSessions (cognitive 20): bot.formatDesktopSessions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 3, match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/bot/desktop.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbe124b705d3092b4d3ffe8ea762371dba83ebb8d32a650c75373547dc4bf696"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.collectHooks (cognitive 20): capdiag.collectHooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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":"internal/capdiag/collect.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"b64b0d5b69fff49bd4d1640390770f3b9e8f5491aa81aaf3db05e940aa3920c3"}},{"ruleId":"D2","level":"warning","message":{"text":"checkpoint.CapturePath (cognitive 20): checkpoint.CapturePath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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":"internal/checkpoint/capture.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8d57fc41406e09d6df3e0f0c9485d78ac4ad95e66f9b00253fbee88645b723e"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.configCompactRatioCommand (cognitive 20): cli.configCompactRatioCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (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":"internal/cli/cli.go"},"region":{"startLine":2601}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a905d9d76a709664bfb823a532ec4be8b883d38fe98612743be4d6d99de14fd"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.skillRootLines (cognitive 20): cli.skillRootLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, 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":"internal/cli/skill_picker.go"},"region":{"startLine":526}}}],"partialFingerprints":{"codehealthFindingId/v1":"53281a5d6800fcd59b5cc5b66987f1e8a3a637296b3b75b84f133eda4892bb12"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.queryTerminalBackground (cognitive 20): cli.queryTerminalBackground has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, 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":"internal/cli/theme_osc_unix.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"b09f354d357c6386e36a49aac6d35d3580dd601efb5863bb071c254ccfb7c379"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.renderApprovalBanner (cognitive 20): chatTUI.renderApprovalBanner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"internal/cli/chat_tui.go"},"region":{"startLine":3665}}}],"partialFingerprints":{"codehealthFindingId/v1":"547fa7d44411776b7ad36ade6be613d18bdfc50ddd0ade3dfa26fd931bf072fb"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateLegacyTOMLIfNeeded (cognitive 20): config.migrateLegacyTOMLIfNeeded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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":"internal/config/migrate.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5c0fc8eef9e280163c2669aa665dbe96ea5c4b1a507856127b3858183564c79"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateSupportData (cognitive 20): config.migrateSupportData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"internal/config/migrate.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"b883326eae5080665d47008d903385223ff4787c3cc69e6b6b50b3d49336434b"}},{"ruleId":"D2","level":"warning","message":{"text":"config.EditUserConfigWithCredentials (cognitive 20): config.EditUserConfigWithCredentials has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 6). Of this number, 14 points are the body\u0027s own statements and 6 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":"internal/config/remote_credentials.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"29e93aa54a5f338489595c8feb8b149767bb4e8bb6ed63b62b6e0bdc29ee198f"}},{"ruleId":"D2","level":"warning","message":{"text":"control.walkRootDir (cognitive 20): control.walkRootDir has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, loops 1 (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":"internal/control/refs.go"},"region":{"startLine":1126}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca48542d8e101690ed9f3ddea2231bec0b838aa9b625e4ef699bb383dff62847"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.hasSuccessfulCompleteStepForTodo (cognitive 20): evidence.hasSuccessfulCompleteStepForTodo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, 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":"internal/evidence/evidence.go"},"region":{"startLine":2670}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bcb86fa52bc1c72b6b3d2d5289df33d598ae5d552165000718a8f342f98c5aa"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.validateContributions (cognitive 20): extension.validateContributions 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":"internal/extension/builder.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"03d07b35ce9cafece9c7f974bc0f5f45a41199767aa48ba50781a917fd47fe10"}},{"ruleId":"D2","level":"warning","message":{"text":"guardian.ExtractTranscript (cognitive 20): guardian.ExtractTranscript has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 5, match/switch 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/guardian/transcript.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d44385af356db72bad865f9e9340f4742252f4518006afe26fbf444041962df"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.spawnShellCommand (cognitive 20): hook.spawnShellCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, match/switch 1 (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":"internal/hook/hook.go"},"region":{"startLine":1442}}}],"partialFingerprints":{"codehealthFindingId/v1":"d57fdb86098134117751c6847b7e212bb4589066c0e6e0ca89c185a8387bc475"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.planURL (cognitive 20): installSourceTool.planURL has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 6 (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":"internal/installsource/plan.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"d541e273ddba2dead430578220f73674394a1a8dcf73f2b6bfcc8d4db2d70d3a"}},{"ruleId":"D2","level":"warning","message":{"text":"pluginpkg.mergeV1Hooks (cognitive 20): pluginpkg.mergeV1Hooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (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":"internal/pluginpkg/manifest_v1.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a3967ebe3832214b6e8c3128ae6bf063cadc3f9ceebd05d8540872f96d1e380"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.tryNormalizeFastPath (cognitive 20): provider.tryNormalizeFastPath has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, 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":"internal/provider/provider.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b440d1a9466eb43ac7f1f434651fc01ded9fc5d75985d61976c17cb18374f00"}},{"ruleId":"D2","level":"warning","message":{"text":"Gate.ObserveResult (cognitive 20): Gate.ObserveResult has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 5 (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":"internal/recovery/gate.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e38926d1cfebc4ae4288e2c15204ff280f36188407fde39395c1db802fe4d4f"}},{"ruleId":"D2","level":"warning","message":{"text":"remote.parseOpenSSHEffectiveConfig (cognitive 20): remote.parseOpenSSHEffectiveConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, match/switch 2, 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":"internal/remote/sshconfig.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"20f047455a71d052323b93893fa2be0189e648fcdd2ba3f6cb729ff2dc5dfd3d"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.verifyUndoRepairBackups (cognitive 20): repair.verifyUndoRepairBackups has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"internal/repair/transaction.go"},"region":{"startLine":706}}}],"partialFingerprints":{"codehealthFindingId/v1":"e989c5056cec6cbca44b4f950a8988a3fec46b5559f5dc30cf4f3a1970110e7f"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.archiveSupersededPendingMarker (cognitive 20): repair.archiveSupersededPendingMarker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, loops 1 (nesting depth added 8). 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":"internal/repair/update_legacy.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ee5b41cc07bd83c64ef8ca4a275b6ce38d4bc0de0eefe6a8051c0a6dab47969"}},{"ruleId":"D2","level":"warning","message":{"text":"sandbox.bwrapForbidReadArgs (cognitive 20): sandbox.bwrapForbidReadArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/sandbox/seatbelt_other.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"c550782d1ffd9e842a1501947464779985344de59d6f34b0039040fcc2d0af56"}},{"ruleId":"D2","level":"warning","message":{"text":"telemetry.prunePending (cognitive 20): telemetry.prunePending has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, 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":"internal/telemetry/pending.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fcc6e1d309f5f3bf8b83b2341891f3ad807c52034fb9da1a3f1598ee5a17dac"}},{"ruleId":"D2","level":"warning","message":{"text":"main.applyRuntimeTab (cognitive 19): main.applyRuntimeTab has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 5 (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":"desktop/tabs.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"00be589e0c78018d366f426274b7b24838e3c3c9a6bf50a9a6ef1d2aedc04c8e"}},{"ruleId":"D2","level":"warning","message":{"text":"main.topicTitleFallbackForOpen (cognitive 19): main.topicTitleFallbackForOpen has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":4593}}}],"partialFingerprints":{"codehealthFindingId/v1":"4db89778897d9160d682fbcebee3e174888e840bafa4d5956b963941a04530ea"}},{"ruleId":"D2","level":"warning","message":{"text":"main.discoverPluginThemes (cognitive 19): main.discoverPluginThemes has cognitive complexity 19 (threshold 15). Drivers by points: loops 10, if/else 9 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_plugin.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"8630272fbc5c1ddab978a9a520abc672feca01993efba7be9422ef4dac955cac"}},{"ruleId":"D2","level":"warning","message":{"text":"App.CleanRemoteLegacyWorkbenchData (cognitive 19): App.CleanRemoteLegacyWorkbenchData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, match/switch 1 (nesting depth added 10). 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":"desktop/remote_legacy_cleanup.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"22ae4678157ec32bce433f080cc7b333269ab06f7a3f9950ac4aaaa046185cdb"}},{"ruleId":"D2","level":"warning","message":{"text":"App.claimSessionRuntime (cognitive 19): App.claimSessionRuntime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, boolean chains 5, match/switch 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":"desktop/session_runtime.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"20cca73d87d99f837148814c1e053882e9fed37dc690716d898516a38da5538b"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ReconcileSessionSidecars (cognitive 19): agent.ReconcileSessionSidecars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"internal/agent/save.go"},"region":{"startLine":1551}}}],"partialFingerprints":{"codehealthFindingId/v1":"7762e256329402ed22841d8cc5c2fc031202a46f368f51257eed9aca548e1be3"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.RecordDirection (cognitive 19): Store.RecordDirection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, 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, 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":"internal/autoresearch/store.go"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a378affb7c96ce19770a833d0c2c0add3b98541eef7beb6470b2ae5e1fc93e5"}},{"ruleId":"D2","level":"warning","message":{"text":"adapter.handleSDKMessage (cognitive 19): adapter.handleSDKMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 6, match/switch 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":"internal/bot/feishu/feishu.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"28eb9bd979023384a4968c081d45da2389c0004c2a13c36c24c505eb2c432717"}},{"ruleId":"D2","level":"warning","message":{"text":"capability.routeEntry (cognitive 19): capability.routeEntry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, 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":"internal/capability/capability.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"329abc5d0bf0618ecb76f05248bd7d6271b51c097c689240cbd3509e24b7f653"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.FileState (cognitive 19): Store.FileState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/checkpoint/checkpoint.go"},"region":{"startLine":867}}}],"partialFingerprints":{"codehealthFindingId/v1":"5606a4700fa1e12a500b7ea7a581b91b5f9f7ad02944fd017d435c5785ad69e9"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.configReasoningLanguageCommand (cognitive 19): cli.configReasoningLanguageCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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":"internal/cli/cli.go"},"region":{"startLine":2531}}}],"partialFingerprints":{"codehealthFindingId/v1":"3426698b3ac13538125897c6568d0049801eb29515932dd6af274136b8fd3400"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.diffBody (cognitive 19): cli.diffBody has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 2, 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":"internal/cli/diffview.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"fccc8d288e1345049507ff01c8b234339c2b3ee67888f931cbe3351480777e24"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.fixCJKEmphasis (cognitive 19): cli.fixCJKEmphasis has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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":"internal/cli/md.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"793b74458325c479bb8c08fa89b832c0d64b6715b508b283fd5cd54622342dd7"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.remoteConnectCLI (cognitive 19): cli.remoteConnectCLI has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 1 (nesting depth added 5). 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":"internal/cli/remote_connect.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cedaffd4df608e14dc08090d7f6097e86f97b64338764cd5dd7b2ece7a9d48a"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.subagentProgressBlock (cognitive 19): chatTUI.subagentProgressBlock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/chat_tui.go"},"region":{"startLine":2559}}}],"partialFingerprints":{"codehealthFindingId/v1":"1651123ead4376e7dc57e3742a19d61ee87d5000e0ad6bd5391c6055b5a47651"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.acceptCompletion (cognitive 19): chatTUI.acceptCompletion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 6 (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":"internal/cli/complete.go"},"region":{"startLine":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f629a0aa5bd3373c405fc690bfc93e7a22fcaeac6a46602ae3ac8c5528f7a73"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleSkillPickerKey (cognitive 19): chatTUI.handleSkillPickerKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/skill_picker.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb8eb2632e79b1c82e55506141eed5f7af9a5d02bfc976dd4ed8a590e1613810"}},{"ruleId":"D2","level":"warning","message":{"text":"config.InstallUserPluginForRoot (cognitive 19): config.InstallUserPluginForRoot has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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, 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":"internal/config/edit.go"},"region":{"startLine":1071}}}],"partialFingerprints":{"codehealthFindingId/v1":"cea537003c5c0ea10d35a863c21b00f05fc5d7d35b9de82073f3b7b42229c865"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.SearchExternalFolderRefs (cognitive 19): Controller.SearchExternalFolderRefs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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":"internal/control/refs.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"929c5e4719095dca095d57f1abe4f2ebca99c43e3e5c11fe09a0f5ea406d1915"}},{"ruleId":"D2","level":"warning","message":{"text":"gateApprover.approveWithPolicyReason (cognitive 19): gateApprover.approveWithPolicyReason has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 6 (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":"internal/control/controller.go"},"region":{"startLine":5981}}}],"partialFingerprints":{"codehealthFindingId/v1":"7df66957b83af1ddedf1889225f2c0c2573d0bca22d350bb91235c6db8c86376"}},{"ruleId":"D2","level":"warning","message":{"text":"environment.runOne (cognitive 19): environment.runOne has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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":"internal/environment/probe.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dbf7ec595a78cd44dbfc4459f91feebdab0a624621fa56321d383ca55782c2b"}},{"ruleId":"D2","level":"warning","message":{"text":"Conn.writerLoop (cognitive 19): Conn.writerLoop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e2b7470de32e0298ab7fc160c8f60e17261d661706c037d1ba4bdc78cffbe9f"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.scanGitHubSkills (cognitive 19): installSourceTool.scanGitHubSkills has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 10). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 236). 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":"internal/installsource/plan.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"caf88a3b8329adce1883c09628fc07ca32dc22ef0e301b60bbf971684fa8f7d7"}},{"ruleId":"D2","level":"warning","message":{"text":"instruction.resolveDocumentImports (cognitive 19): instruction.resolveDocumentImports has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"internal/instruction/resolver.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dd545bf31a3d2dacbdc4f9b2f148f3af0b55ddbe989b90894993b3aa4bfc080"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.SetActiveSessionPath (cognitive 19): Manager.SetActiveSessionPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"internal/jobs/jobs.go"},"region":{"startLine":1240}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ac394d3d35552284d6d3e261a0d9bab2cf45bafc0bf271c040c3f3e2b4412c3"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.globalGuidanceForProject (cognitive 19): Store.globalGuidanceForProject has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 6, 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":"internal/memory/store.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"0629c4f6d45db57bfa125dee81121da5d305330820f29778aec797d092f74c66"}},{"ruleId":"D2","level":"warning","message":{"text":"sseTransport.readLoop (cognitive 19): sseTransport.readLoop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 6). 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, split the body into named stages: move each independent 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":"internal/plugin/transport_sse.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc89db5f417ea5edfef36d5725e224191ff1c7e9a4e5a72e02b7907a4e4bb278"}},{"ruleId":"D2","level":"warning","message":{"text":"productdocs.buildIdentity (cognitive 19): productdocs.buildIdentity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, match/switch 4, loops 3, boolean chains 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":"internal/productdocs/docs.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"d82dc9e66f2757d781cb190131b46ebff59aa349dd3cbcd85551e069a28a72d8"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.StreamWithRequestBudgetEstimate (cognitive 19): provider.StreamWithRequestBudgetEstimate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, match/switch 5, boolean chains 1, loops 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 107). 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":"internal/provider/request_budget.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"f93a137c4dec11b3b197cd25210cbfd55ac08b6683580057201e1399e2b5a8b4"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.Decide (cognitive 19): recovery.Decide has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 5 (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":"internal/recovery/decision.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"94a0af3cdd7cf1ecfb24d6ac5a7c08fb4a19cfc0a84efd89b56060cd88120bc6"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.commandFieldsHighRisk (cognitive 19): recovery.commandFieldsHighRisk has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5, match/switch 1 (nesting depth added 2). 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":"internal/recovery/rules.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ce73df87f3d51dbd4a1d7bb82ccb652514fa052298db868932d2bf003a6161b"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.EnsureServe (cognitive 19): bootstrap.EnsureServe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 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":"internal/remote/bootstrap/bootstrap.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a9d738e53114c4c62d4ac18f869577737d52ad1bd7fea51e6c9ca699244d69c"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.ReconcilePendingUpdate (cognitive 19): repair.ReconcilePendingUpdate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"internal/repair/update.go"},"region":{"startLine":1881}}}],"partialFingerprints":{"codehealthFindingId/v1":"3395c2556e9afb10634a8578275ad9c96c24cfcdaa62da61f27120d9769d3abd"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.switchModelLocked (cognitive 19): Server.switchModelLocked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 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":"internal/serve/serve.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"c43cb1df559c797a74d21d404dd74b8e79cc43be0fbddb0ce58b4812e929824f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.sessionHintNeedles (cognitive 19): builtin.sessionHintNeedles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 7, boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 250, 266, 236). 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":"internal/tool/builtin/session_guard.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5c9ecb32a210ec58d50066b683cd148f66d1c803053533a4969f8cc2744e366"}},{"ruleId":"D2","level":"warning","message":{"text":"bash.Execute (cognitive 19): bash.Execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4 (nesting depth added 4). Of this number, 13 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":"internal/tool/builtin/bash.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b10c2c279f7e94de3d2769684b843a83899111503e68e94c58dd62cdb17043c"}},{"ruleId":"D2","level":"warning","message":{"text":"grepTool.runRipgrep (cognitive 19): grepTool.runRipgrep has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"internal/tool/builtin/grep.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd6bb94ba1dd600395644f77e36f53fb1030fa55b030b3e231c9117d04d3981a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.historyToolSummary (cognitive 18): main.historyToolSummary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 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":"desktop/app.go"},"region":{"startLine":6233}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb26c2e8044cb9e865ab8ccb953af04122d6edb4579abe0e5896b9e81c784782"}},{"ruleId":"D2","level":"warning","message":{"text":"main.upsertEnvFile (cognitive 18): main.upsertEnvFile 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/dotenv.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"7baa5f1dc0c9cbac9df9cd1764a77bf5248d7e89e63c8a6cc92b370bcc14c2b4"}},{"ruleId":"D2","level":"warning","message":{"text":"main.suggestMemories (cognitive 18): main.suggestMemories has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 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":"desktop/memory_suggestions.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"22bdfd1c3da8792b7c25fbb32d6b164b62a882ccbc9c6f01e841d603bd577c85"}},{"ruleId":"D2","level":"warning","message":{"text":"main.trashSessionArtifactsBeforeMove (cognitive 18): main.trashSessionArtifactsBeforeMove has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"desktop/sessions.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"26bb9fca159693f78fff9d8031a49cc33c38a94daa462ffe34dc4b023c44dff0"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateSessionPath (cognitive 18): main.validateSessionPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/sessions.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"a037a3b06d1617f67b3319aec9d8e3d73292a7c5eec6e018342f5feaeead7c58"}},{"ruleId":"D2","level":"warning","message":{"text":"main.applyProjectTreeOrder (cognitive 18): main.applyProjectTreeOrder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, 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":"desktop/tabs.go"},"region":{"startLine":5387}}}],"partialFingerprints":{"codehealthFindingId/v1":"17fbebb472d2e026229ecb2550de447ba1100b0f271c5f7a500c285affd2b7c6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.currentLauncherPath (cognitive 18): main.currentLauncherPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, 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":"desktop/updater.go"},"region":{"startLine":1409}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3d853fd39750df7719c11a96408ff58cf1ef2c42ed9ecc0bacd8d3cc83ce2b5"}},{"ruleId":"D2","level":"warning","message":{"text":"main.firstWindowsExecutable (cognitive 18): main.firstWindowsExecutable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/external_opener_windows.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f958dfa59e5ae46807a9d9b08c3ccde112e7139a68721bf28cd7fd756f48659"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cleanupOwnedMacUpdateDirectory (cognitive 18): main.cleanupOwnedMacUpdateDirectory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"desktop/updater_mac.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"8130dc95935c447b0242ec1647d1ffe77f8c5a6d1ef705f70ee6d1bf582702aa"}},{"ruleId":"D2","level":"warning","message":{"text":"App.shutdown (cognitive 18): App.shutdown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 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":"desktop/app.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"c887f47301dbbb4f36272c858a31b5cffee34a515dd402fd7f6258f34df1cbd4"}},{"ruleId":"D2","level":"warning","message":{"text":"App.deleteSession (cognitive 18): App.deleteSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 4). Of this number, 9 points are the body\u0027s own statements and 9 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, 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":"desktop/app.go"},"region":{"startLine":3383}}}],"partialFingerprints":{"codehealthFindingId/v1":"c75a3b94a72e09e148f3eef08796649f9c3fc0b24383701a9e2595e4b1051cf6"}},{"ruleId":"D2","level":"warning","message":{"text":"App.buildSessionRebindCandidate (cognitive 18): App.buildSessionRebindCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 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":"desktop/app.go"},"region":{"startLine":4557}}}],"partialFingerprints":{"codehealthFindingId/v1":"26fdb1b92494adca8d4bf812cea8282803573dea52aaa457b66613637f797a04"}},{"ruleId":"D2","level":"warning","message":{"text":"App.canReclaimCurrentProcessSessionLease (cognitive 18): App.canReclaimCurrentProcessSessionLease has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":9892}}}],"partialFingerprints":{"codehealthFindingId/v1":"f46acbfeb18857075cbb908a150bc9a76b30ed0172d7bd8fc52b86c78a545da3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ListDirForTab (cognitive 18): App.ListDirForTab 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":"desktop/app.go"},"region":{"startLine":10675}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec96b8712215129e6aa1925311020bc789edc07f5f56976624bdc9ca45bf2f67"}},{"ruleId":"D2","level":"warning","message":{"text":"App.memoryForCtrl (cognitive 18): App.memoryForCtrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 8 (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":"desktop/app.go"},"region":{"startLine":11634}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3682032152507fc4060599efb5769ca7195412e5258f879882cef4b82b6ba4d"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ReorderProjects (cognitive 18): App.ReorderProjects has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 7126). 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":"desktop/tabs.go"},"region":{"startLine":7125}}}],"partialFingerprints":{"codehealthFindingId/v1":"c99c3b23c13c87581f32e55d591901fa73ad16b561c38b7dfa2f951cc58584bf"}},{"ruleId":"D2","level":"warning","message":{"text":"acp.listACPMetas (cognitive 18): acp.listACPMetas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"internal/acp/service.go"},"region":{"startLine":2723}}}],"partialFingerprints":{"codehealthFindingId/v1":"72d8e169bcec1ae4ba272cce25f2722ba86d467436c2040c740dd89770eafbc0"}},{"ruleId":"D2","level":"warning","message":{"text":"updateSink.permissionMeta (cognitive 18): updateSink.permissionMeta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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":"internal/acp/dispatch.go"},"region":{"startLine":416}}}],"partialFingerprints":{"codehealthFindingId/v1":"3879459b31d0c2e61666cda322c0871484f35459271e9b00b6706f44e8671f48"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ListCleanupPending (cognitive 18): agent.ListCleanupPending has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/agent/save.go"},"region":{"startLine":1472}}}],"partialFingerprints":{"codehealthFindingId/v1":"a60532c1a27f042c64bdd347880d802d4a77a42410d96742018f49ae4ffc4dfa"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.reconcileOverlongSessionFilenames (cognitive 18): agent.reconcileOverlongSessionFilenames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/agent/save.go"},"region":{"startLine":1693}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bf1c87dbb2876b4be5a0cbff6397fb3a850d1fdb420f75828d631af1593c344"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.probeSessionEventLogWithLimits (cognitive 18): agent.probeSessionEventLogWithLimits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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":"internal/agent/session_events.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"71b024b5236a7b22569c9279f8292a171c06e51e88c5ea994027563a13b49901"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.rebuildTodoState (cognitive 18): Agent.rebuildTodoState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 6, 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":"internal/agent/agent.go"},"region":{"startLine":2607}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bb8b2765e3e3371d3d3d772f26378afb8d524c4acb5f00d7c0f961e79cc98e5"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.maybeCompact (cognitive 18): Agent.maybeCompact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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":"internal/agent/compact.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"124b61a272a7caa48192a87a5139a4a3599cb56c50127f765a66f27e7301dbba"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.summarize (cognitive 18): Agent.summarize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 2, loops 1 (nesting depth added 8). Of this number, 15 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":"internal/agent/compact.go"},"region":{"startLine":709}}}],"partialFingerprints":{"codehealthFindingId/v1":"a896e4d0ce5d185082fae1f96003133460b6c52011f90d1fc49c692882ae7d5d"}},{"ruleId":"D2","level":"warning","message":{"text":"SubagentResultTool.Execute (cognitive 18): SubagentResultTool.Execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, loops 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":"internal/agent/subagent_result.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"9903fced5a73dfacb7ce6aa4fc887068ef1fd994525647f2da611b4f381015aa"}},{"ruleId":"D2","level":"warning","message":{"text":"TaskTool.buildTaskSpec (cognitive 18): TaskTool.buildTaskSpec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/agent/task.go"},"region":{"startLine":722}}}],"partialFingerprints":{"codehealthFindingId/v1":"64342ebace269647c9e3d6659187a0f462079127fec65c0d3be18d7c4b130850"}},{"ruleId":"D2","level":"warning","message":{"text":"autoresearch.tailJSONLLines (cognitive 18): autoresearch.tailJSONLLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"internal/autoresearch/store.go"},"region":{"startLine":798}}}],"partialFingerprints":{"codehealthFindingId/v1":"92b3bdb1b8b17dfa3ed43ebd27ec3977bd8e31c61eaa0368f5006daf8e1ba9ea"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.reserveTaskID (cognitive 18): Store.reserveTaskID has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/autoresearch/store.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e698caf2a1bfbeced89d2a029b4f94c2e11947baf18e62f6c60da0dec387c3d"}},{"ruleId":"D2","level":"warning","message":{"text":"boot.normalizeAdditionalDirs (cognitive 18): boot.normalizeAdditionalDirs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/boot/boot.go"},"region":{"startLine":2386}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c7dc3cc27beab14e13ae42ba9c8c40fc7fba4717a682fe1eecf3612627a140a"}},{"ruleId":"D2","level":"warning","message":{"text":"boot.addBuiltins (cognitive 18): boot.addBuiltins has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 7 (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":"internal/boot/boot.go"},"region":{"startLine":2634}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b7bb6674ce1d6628780614b06e5cace4d29d0e1f53b179eb76d39f4fdafded"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.lastSemanticBoundary (cognitive 18): bot.lastSemanticBoundary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/bot/render.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce9d4cad463e36e52ce717b0afc76e23449f1ddb7400bbd3bd76b8f0bdf4153c"}},{"ruleId":"D2","level":"warning","message":{"text":"weixin.PollLogin (cognitive 18): weixin.PollLogin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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":"internal/bot/weixin/weixin_login.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"e48bbbf3924275f42292c75e354aa63e2dd12715ba7de8700a2aaedcaed0c724"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.CaptureAfter (cognitive 18): Store.CaptureAfter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":503}}}],"partialFingerprints":{"codehealthFindingId/v1":"435418862b2d78c1ce8de71802054ba97ef741bcd2e1284414f7d4892b7f306c"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.expandedPasteBodies (cognitive 18): cli.expandedPasteBodies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, 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":"internal/cli/chat_tui_paste.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"cee6b7a652fe1f4a008fa0c113f6b7f4a05d9e9161fd248f2a0210c6e333d0ed"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.pastedImageSourcesForOS (cognitive 18): cli.pastedImageSourcesForOS has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 3 (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":"internal/cli/chat_tui_paste.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"b908ac7a19a9a50a82dc69b2dbd6b7b197b6b5b2e621cc672bd2ef9d4a32e261"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.remoteServeCLI (cognitive 18): cli.remoteServeCLI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/cli/remote_connect.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad9d45c8910b2ebd7a7fa10f3e36ef02581120771a1cbdcee787dc3903de62f4"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.orderResumeSessions (cognitive 18): cli.orderResumeSessions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 7 (nesting depth added 7). Of this number, 15 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/resume.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"f86ba0d34f0a6df33d9bb6e6f07997149ec5b3aeb66283651cee6c0b05349d29"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.runProviderSetupManager (cognitive 18): cli.runProviderSetupManager has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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":"internal/cli/setup_manager.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"a848da432771ee157e69fa6861bdedefb99d2e2b1fd3e5695e9b5a7f50d2e624"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.parseCLIUpgradeSyntax (cognitive 18): cli.parseCLIUpgradeSyntax has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/cli/upgrade.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"a793a8d14a41d471c83278d5b09f486ccf270ea1c0d089c65bb6510aec6d5162"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.runLanguageSubcommand (cognitive 18): chatTUI.runLanguageSubcommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 1). Of this number, 11 points are the body\u0027s own statements and 7 belong 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":"internal/cli/language.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"5db8ebdf88b202b6bf3594595c0d306027d91ba923fc6ac1c4928e686259ce1c"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.handleResumePickerKey (cognitive 18): chatTUI.handleResumePickerKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, 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":"internal/cli/resume_picker.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"dadc8cca57693e274d69cbda3f220d0e799cf934d5be4ef60af0a3a6eae1d46a"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.renderSkillPickerSkills (cognitive 18): chatTUI.renderSkillPickerSkills has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, 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":"internal/cli/skill_picker_view.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c058e17468c91034eb7f075e2b3ace7279fbd99843b64c13bfbbf4d3b5668ad"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.statusModelWorkGroup (cognitive 18): chatTUI.statusModelWorkGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/status_footer.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"7348173ebfb47ff2819ca5ddaa6b517bfc1c944ab005ac56d8adb96bf3a747f6"}},{"ruleId":"D2","level":"warning","message":{"text":"quickPicker.render (cognitive 18): quickPicker.render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/cli/quick_picker.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d0d1d7ff71d7ef470a4ceb29c1fb1e2b2c77db79de95e32f599958bb0f3701b"}},{"ruleId":"D2","level":"warning","message":{"text":"providerSetupSession.recordAccessTransition (cognitive 18): providerSetupSession.recordAccessTransition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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":"internal/cli/setup_manager.go"},"region":{"startLine":298}}}],"partialFingerprints":{"codehealthFindingId/v1":"12e39f54db4048b1845f5c66c9f950c9a04d1c625140fee8cf6734007545e4f2"}},{"ruleId":"D2","level":"warning","message":{"text":"config.stripTOMLKeyLines (cognitive 18): config.stripTOMLKeyLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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":"internal/config/load.go"},"region":{"startLine":1134}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f6ff46413fd6accce03156323f792a9ffc5022fc091178d067b83e840e461bb"}},{"ruleId":"D2","level":"warning","message":{"text":"config.migrateMCPToUserConfig (cognitive 18): config.migrateMCPToUserConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/migrate.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"e20efd21c2de42fbd9c444e0b2324b110488e1aabdd061e62475b3e0716c0fc9"}},{"ruleId":"D2","level":"warning","message":{"text":"config.validateRemoteHost (cognitive 18): config.validateRemoteHost has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, match/switch 3, 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":"internal/config/remote.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ed74c1801dc1233ccd342471252d0701a2a000afd0cc79ccec26d7cee0848ee"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.RemoveProvider (cognitive 18): Config.RemoveProvider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 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":"internal/config/edit.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"72c48a7b4f22636c8108428cc95d62e37a923e3465ef9daaeaa3846eee6c6b97"}},{"ruleId":"D2","level":"warning","message":{"text":"control.SaveAttachmentFile (cognitive 18): control.SaveAttachmentFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3. 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":"internal/control/attachments.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"881c7d1bb8b3a84072e9fd5bd69eb1bb8dd676f0c97f9f8edde4bdcdabb2907d"}},{"ruleId":"D2","level":"warning","message":{"text":"control.listItem (cognitive 18): control.listItem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 4, loops 3, 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, 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":"internal/control/controller.go"},"region":{"startLine":6448}}}],"partialFingerprints":{"codehealthFindingId/v1":"c70fc25079a3cd129603e9a046374ba153e555533e2253b83ca16de5a0b590ce"}},{"ruleId":"D2","level":"warning","message":{"text":"control.MemoryCommandText (cognitive 18): control.MemoryCommandText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/control/memory_command.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"254609f1116651d0dd98d4236c965124b330765754b39dd7f843ec17af289212"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.applyPlanExec (cognitive 18): Controller.applyPlanExec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (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":"internal/control/controller.go"},"region":{"startLine":1619}}}],"partialFingerprints":{"codehealthFindingId/v1":"77b2d692a6ee8dc807242183baa9d7cc955fdd5854632ccf8acabc81524710fc"}},{"ruleId":"D2","level":"warning","message":{"text":"Ledger.HasReadEvidenceForPath (cognitive 18): Ledger.HasReadEvidenceForPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/review_report.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce7aa702d6e6f6ef4cf5ce67bff397f7216eaf1060622422ca87f7026b132859"}},{"ruleId":"D2","level":"warning","message":{"text":"uihub.AskRequestFunc (cognitive 18): uihub.AskRequestFunc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, match/switch 4, loops 3, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 625). 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":"internal/extension/uihub/hub.go"},"region":{"startLine":624}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bf9c9fec451e3fcdb539c0b380c640e00a0b88145c21c89322f8ad33a5aebf6"}},{"ruleId":"D2","level":"warning","message":{"text":"frontmatter.addYAMLValue (cognitive 18): frontmatter.addYAMLValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, match/switch 1 (nesting depth added 10). 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":"internal/frontmatter/frontmatter.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"0da3cc3ea82cdfb5a076d48ae31ae17f052507f91b41dbf7ad5c11bf3c066bfa"}},{"ruleId":"D2","level":"warning","message":{"text":"hook.fillClaudeAskDefaults (cognitive 18): hook.fillClaudeAskDefaults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"internal/hook/hook.go"},"region":{"startLine":798}}}],"partialFingerprints":{"codehealthFindingId/v1":"f12d27c1841d8de89864b7768635b0242d7c867a514e9c24f63a4f38a1b43c1c"}},{"ruleId":"D2","level":"warning","message":{"text":"migration.migrateLegacyMemorySources (cognitive 18): migration.migrateLegacyMemorySources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 2 (nesting depth added 5). 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, split the body into named stages: move each independent 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":"internal/migration/migration.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"c936fddeafdb2f968f9ac9f630a3d8022b8ed709eff1b2658b065b58df94615b"}},{"ruleId":"D2","level":"warning","message":{"text":"releaseasset.extractCLI (cognitive 18): releaseasset.extractCLI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/releaseasset/cli.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6d074f552018c7f78c161dd179c2827043b36c0d060d9e042a13bcf82d35568"}},{"ruleId":"D2","level":"warning","message":{"text":"forward.ParseShorthand (cognitive 18): forward.ParseShorthand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/remote/forward/forward.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd7e6e5d16398f22af9cabc6b73e2c8c0343191888763e435f5592edaaf07fbc"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.Diagnose (cognitive 18): repair.Diagnose has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 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":"internal/repair/diagnose.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"360a4e08bc76707479426d5feab510151297137464453b0c1991b7cb253ff46e"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.lockRepairMutationsTimeout (cognitive 18): repair.lockRepairMutationsTimeout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (nesting depth added 6). 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":"internal/repair/mutation_lock.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7e2f2ce18889649fe9823641b41f9a6bd4a4915662d8842aaaf7414429bef48"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.ListConfigSnapshots (cognitive 18): repair.ListConfigSnapshots has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 5). Of this number, 15 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":"internal/repair/snapshot.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea7ce4fb473403216edace6f9e3d590be99cb9d2ffa9132b7f7c1fce5197aef2"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.claimPendingAppBundleUpdateHandoff (cognitive 18): repair.claimPendingAppBundleUpdateHandoff has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4. 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":"internal/repair/update.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecb5e11591c80a6d8e69965edb663246f467f09abc7815acfa3425a31dff66d1"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.verifyPreparedFileUpdateTargets (cognitive 18): repair.verifyPreparedFileUpdateTargets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"internal/repair/update.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"53435a847c3d4da4509500f9d0e48b2cc42c87b1551733f5765e1ab6b1005ee8"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.resume (cognitive 18): Server.resume has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (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":"internal/serve/serve.go"},"region":{"startLine":1107}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6c45c577c2c86e2769bbbf8f41accaba77c97825f789daaa63fe5798fdfec4b"}},{"ruleId":"D2","level":"warning","message":{"text":"shellparse.ParseStaticCommand (cognitive 18): shellparse.ParseStaticCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"internal/shellparse/bash.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1de09d291ab055bc6ba64edf1cc577972a75a6afa679c1defdef49f0847e058"}},{"ruleId":"D2","level":"warning","message":{"text":"FileStore.SaveTask (cognitive 18): FileStore.SaveTask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, match/switch 1. 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, 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":"internal/taskmonitor/jsonstore.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2af4aa363b5edfa876696a98cb23c5c7f62f2e8cc06bc238fde9fa47562e410"}},{"ruleId":"D2","level":"warning","message":{"text":"TmuxAdapter.Detach (cognitive 18): TmuxAdapter.Detach has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"internal/taskmonitor/tmux.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f3a652204d7b7ffb9af9992c528b37f3e526e010a3668370ee9eedef4f17b4e"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.sendDailyPing (cognitive 18): Client.sendDailyPing has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/telemetry/client.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"9181f77c85169bca4187de30d2194db7cf8badfe645d71ab5b905dabdeeb1570"}},{"ruleId":"D2","level":"warning","message":{"text":"sink.observe (cognitive 18): sink.observe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, match/switch 1 (nesting depth added 8). 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":"internal/telemetry/sink.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"45e42b6551a03a175262421f39737355d1690ec4dcce4082409fdf1fe8c24a9f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.verifyCommandFromSession (cognitive 18): builtin.verifyCommandFromSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/tool/builtin/completestep.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"499eef196dd26f7546bbc84d2c4456843ce8425c87f91e2302c6b3730f0964d9"}},{"ruleId":"D2","level":"warning","message":{"text":"writeFile.Execute (cognitive 18): writeFile.Execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4 (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":"internal/tool/builtin/writefile.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"d490b431df98136661227a63caec390cd9cbf4735f2465d1a06014f6ca37c2b6"}},{"ruleId":"D2","level":"warning","message":{"text":"worktree.inspect (cognitive 18): worktree.inspect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (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":"internal/worktree/worktree.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"49f010bd84659d15e9d24e91bb5e3b16175baee0b4be5d9d0c63c8ff680d495f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.historyProviderMessagesWithPersistedTimes (cognitive 17): main.historyProviderMessagesWithPersistedTimes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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":"desktop/app.go"},"region":{"startLine":5574}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fbf4631f6158fe94e3131653a90fb38310c6cf03c850075db4ebade2692c6c6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.skillRootsViewFrom (cognitive 17): main.skillRootsViewFrom has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 7, 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":"desktop/app.go"},"region":{"startLine":8499}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4ca794b0f843814d0612259394f76fc0fd9cbec75cd7c292eac868b1572f238"}},{"ruleId":"D2","level":"warning","message":{"text":"main.normalizeSkillPath (cognitive 17): main.normalizeSkillPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"desktop/app.go"},"region":{"startLine":8774}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c8ab656677dc9ac74e4c38dff8f453a0ec37d51300deadc06e19ff61eacbe14"}},{"ruleId":"D2","level":"warning","message":{"text":"main.parseHeartbeatSchedule (cognitive 17): main.parseHeartbeatSchedule has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/heartbeat.go"},"region":{"startLine":599}}}],"partialFingerprints":{"codehealthFindingId/v1":"865db147c312e2b001990771f9d7496b3289c33cc9f60f50d3ce6a4fc7ea8e77"}},{"ruleId":"D2","level":"warning","message":{"text":"main.previousHeartbeatWeeklyAt (cognitive 17): main.previousHeartbeatWeeklyAt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 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":"desktop/heartbeat.go"},"region":{"startLine":682}}}],"partialFingerprints":{"codehealthFindingId/v1":"e11e0db15e929df1681532d24598e39b1e6a9dabe7124ecff82f8ee424cc534d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.normalizeProjectsFile (cognitive 17): main.normalizeProjectsFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/tabs.go"},"region":{"startLine":5199}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4ca0711ad1b9fc7d8694f10eae80a852047c80c9d1457a5d21a9744b77f08ee"}},{"ruleId":"D2","level":"warning","message":{"text":"App.removeTopicRuntimeBindings (cognitive 17): App.removeTopicRuntimeBindings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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":"desktop/app.go"},"region":{"startLine":3522}}}],"partialFingerprints":{"codehealthFindingId/v1":"9485748763107464320b9f825c1a43f3e9c7f368a9dc4f3e60654b514649cad7"}},{"ruleId":"D2","level":"warning","message":{"text":"App.prepareRemovedSessionRuntimes (cognitive 17): App.prepareRemovedSessionRuntimes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"desktop/app.go"},"region":{"startLine":3598}}}],"partialFingerprints":{"codehealthFindingId/v1":"05f4f4491ee173de5720e02ba95ea570580fbf81fcbe6736e4c13e933a479de0"}},{"ruleId":"D2","level":"warning","message":{"text":"App.WorkspaceConflictForTab (cognitive 17): App.WorkspaceConflictForTab has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2 (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":"desktop/background_runtime.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"cea5bf0222ddfed4dfb8d6d50047158d6ff45bbe5582b2405857d0d6eeef75cd"}},{"ruleId":"D2","level":"warning","message":{"text":"App.TrySubagentProfile (cognitive 17): App.TrySubagentProfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"desktop/subagents_app.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbbf4e17c00a10c00735a286d2cf4b2717ab8213f9c73896b36c84f47fcec7d3"}},{"ruleId":"D2","level":"warning","message":{"text":"App.themeAssetMiddleware (cognitive 17): App.themeAssetMiddleware has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3. 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 22). 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":"desktop/theme_assets.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3fd935fe632105bcf131a3388c12246e24a09947b42b98f521927230cdd5561"}},{"ruleId":"D2","level":"warning","message":{"text":"promptHistoryTape.readOlder (cognitive 17): promptHistoryTape.readOlder has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/app.go"},"region":{"startLine":4833}}}],"partialFingerprints":{"codehealthFindingId/v1":"07e63f79bb941f1f19ee282340806a061dd947a5b019a05a9f72f65385523510"}},{"ruleId":"D2","level":"warning","message":{"text":"main.activateVersionedWindowsFromStaging (cognitive 17): main.activateVersionedWindowsFromStaging has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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":"desktop/cmd/update-helper/versioned_windows.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"672fd27337795bc0c7b02fa1cd2283114aeef14906a596732de18e2553e02c55"}},{"ruleId":"D2","level":"warning","message":{"text":"acp.mcpSpecs (cognitive 17): acp.mcpSpecs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"internal/acp/service.go"},"region":{"startLine":2910}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca6e497e577af9026e2101093219029b5e86b0f118e22c5171006f66bb745c96"}},{"ruleId":"D2","level":"warning","message":{"text":"service.reloadSessionExtensionsLocked (cognitive 17): service.reloadSessionExtensionsLocked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (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":"internal/acp/service.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb0ed531f14ac681460258719aaa02ff5ded38a3b81edf8c1ba4c4824de291b2"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.New (cognitive 17): agent.New has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. To reduce it, split the body: this score is breadth rather than depth \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":"internal/agent/agent.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a4fee9d4f0146d97264307c52bed83d75f2832b4bca10947edbe12898c97168"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.parsePlannerAskBlock (cognitive 17): agent.parsePlannerAskBlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 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":"internal/agent/coordinator.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a4af3a0638a66f7a3d52bb6f7c3367192ab8254a5be4bb4f28032001c2ff354"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.ListSubagentsByParent (cognitive 17): agent.ListSubagentsByParent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"internal/agent/subagent_store.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"02923a1e246df4ce197203ecfcc04ec3aedc249eda56d6ae74fcdff3533c41c6"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.PlannerToolRegistry (cognitive 17): agent.PlannerToolRegistry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, 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":"internal/agent/task.go"},"region":{"startLine":1521}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4e0e01a426b6e6e4402d8d9b72620ded3da660303c6cc45acb0a81d82179b53"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryTaskHasFollowUpAfterChat (cognitive 17): agent.deliveryTaskHasFollowUpAfterChat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 4, boolean chains 2, match/switch 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":"internal/agent/task_heuristic.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"34f1b2e78647fb8a46a521e86cad6c08d3329ac641f82b9ca1fb7212b7770b01"}},{"ruleId":"D2","level":"warning","message":{"text":"Agent.handleFinalResponse (cognitive 17): Agent.handleFinalResponse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (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":"internal/agent/run_loop.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"e905f7e11db4bc09884627054da65f694b68fb5f7255796082d0c72e8a59a9d6"}},{"ruleId":"D2","level":"warning","message":{"text":"AskTool.Execute (cognitive 17): AskTool.Execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, 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":"internal/agent/ask.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"21b89e3f30d9f7c7be6c66da1eb85cc23f40a54714f7826a31f8dfbd991d5ffc"}},{"ruleId":"D2","level":"warning","message":{"text":"SubagentStore.ReadFinalAnswer (cognitive 17): SubagentStore.ReadFinalAnswer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, 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":"internal/agent/subagent_result.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f6a5a0812bbffd0c7de169a779bdb3ad9147bd5cab02ed7873d9311a235c0e0"}},{"ruleId":"D2","level":"warning","message":{"text":"SubagentStore.nearestLineageSource (cognitive 17): SubagentStore.nearestLineageSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, 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":"internal/agent/subagent_store.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4522cafa74a610b2b86393d081fe469f68850ed6142fcd96038db7aae4700b8"}},{"ruleId":"D2","level":"warning","message":{"text":"UseCapabilityTool.listServers (cognitive 17): UseCapabilityTool.listServers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/agent/usecapability.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"017484c13b9b0dc052862b0171ff13c4ae20b326b93f0bad3f7cf39f0334e694"}},{"ruleId":"D2","level":"warning","message":{"text":"onDemandMCPTool.executeWithImages (cognitive 17): onDemandMCPTool.executeWithImages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"internal/agent/usecapability.go"},"region":{"startLine":1093}}}],"partialFingerprints":{"codehealthFindingId/v1":"85bb492522d0f8d9148d1edfdc670464ccfc289853e20343a2b67084a44f382c"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.Readiness (cognitive 17): Store.Readiness has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (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":"internal/autoresearch/readiness.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"db747a3a8d7619c8465c9c777025a3d3b815cbd865dec0d31232e8d1fb39e91c"}},{"ruleId":"D2","level":"warning","message":{"text":"boot.legacyContributions (cognitive 17): boot.legacyContributions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 7 (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":"internal/boot/runtime.go"},"region":{"startLine":376}}}],"partialFingerprints":{"codehealthFindingId/v1":"e51a33285fa14f6cf7d89e68c6b6442d8daf4a74ff70b8ac803caa7b40ff88ac"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.saveOneInboundMediaItem (cognitive 17): bot.saveOneInboundMediaItem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (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":"internal/bot/media.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"8505fdf9de2cbdd0bf25d8d4c94683d4e3dc8e39db16cda1fdeac268cf926bcc"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.mergeBotSessionEntry (cognitive 17): bot.mergeBotSessionEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"internal/bot/project_index.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"57464c1d9c509d839ed9729e441585678a0e6368adc21741b84d66fa122c31fc"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.formatBotSessions (cognitive 17): bot.formatBotSessions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"internal/bot/project_index.go"},"region":{"startLine":515}}}],"partialFingerprints":{"codehealthFindingId/v1":"be067fc37c7f9e0f85257f83dc122c5b51a913b1bc39c0040b77acefaa82484a"}},{"ruleId":"D2","level":"warning","message":{"text":"SemanticRouter.callModel (cognitive 17): SemanticRouter.callModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 2, loops 2, match/switch 2 (nesting depth added 5). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/capability/semantic.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"607a9865e1a2c6bf78901557f470729941f35558acb5ed2b4615a63036cf0efe"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.runHookCommand (cognitive 17): cli.runHookCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 5). Of this number, 13 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":"internal/cli/hook_machine.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"369c9e4f6d5dd4f6fb146541277f560247cb15ddd60f4df64c993fb8bd06c9e4"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.remoteImportCLI (cognitive 17): cli.remoteImportCLI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 2 (nesting depth added 4). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 243). 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":"internal/cli/remote.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e7b9a65ca8749963a5c389547b2e54aabe7cd330f32c005a605ee658d12862e"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.showStatusDetails (cognitive 17): chatTUI.showStatusDetails has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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":"internal/cli/chat_tui.go"},"region":{"startLine":4771}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9984f66c4e2b93698d669dd583cf46e9076198f68e0cb794df83a168fda96fb"}},{"ruleId":"D2","level":"warning","message":{"text":"mdRenderer.renderTableRow (cognitive 17): mdRenderer.renderTableRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, 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":"internal/cli/md.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"c09130ac53376cc6dc95666cd76740d19a72df839733765b4d2e71753dd7313e"}},{"ruleId":"D2","level":"warning","message":{"text":"config.classifyMCPImportCandidate (cognitive 17): config.classifyMCPImportCandidate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/ccswitch.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bf6b8463f59734f92a28209bc85d201e07736f86e63849f220e1c35bf0e5036"}},{"ruleId":"D2","level":"warning","message":{"text":"config.storeCredentialsInFile (cognitive 17): config.storeCredentialsInFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 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":"internal/config/credentials.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f724c8603486a8e19f69674b7488a6621763ada12d1bab53cbb0c0e93b7f83d"}},{"ruleId":"D2","level":"warning","message":{"text":"config.backfillDeepSeekOfficialPrices (cognitive 17): config.backfillDeepSeekOfficialPrices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/load.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"edd4f96380aad5f0e3aa362bb2863c211a2f68245c68b6cd38c9c4b528788c9b"}},{"ruleId":"D2","level":"warning","message":{"text":"config.NormalizeLegacyDesktopProviderAccess (cognitive 17): config.NormalizeLegacyDesktopProviderAccess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, loops 3 (nesting depth added 3). Of this number, 12 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":"internal/config/load.go"},"region":{"startLine":1751}}}],"partialFingerprints":{"codehealthFindingId/v1":"19efeed690084ebc9605c7c4bdbfc0bb5ff691f7d49a4e520fb9d51c90117301"}},{"ruleId":"D2","level":"warning","message":{"text":"config.renderBotSessionMappings (cognitive 17): config.renderBotSessionMappings 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":"internal/config/render.go"},"region":{"startLine":1683}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f283e3fb008caa075a89c003c06d6abda069908baa1c47693a36050ad959712"}},{"ruleId":"D2","level":"warning","message":{"text":"control.renderMemoryInstructions (cognitive 17): control.renderMemoryInstructions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/memory_command.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"b507000ae74b2f77c76fbd494f300f4744d6c944d287a2e724f25e79a7e57ab0"}},{"ruleId":"D2","level":"warning","message":{"text":"control.resolveBareNames (cognitive 17): control.resolveBareNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 2, loops 1 (nesting depth added 5). Of this number, 11 points are the body\u0027s own statements and 6 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":"internal/control/refs.go"},"region":{"startLine":647}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7dccec047d12ccb0947314cc0c137f6a80c54be1868224b1d44e84f6460fbcd"}},{"ruleId":"D2","level":"warning","message":{"text":"control.readFileRef (cognitive 17): control.readFileRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"internal/control/refs.go"},"region":{"startLine":968}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d8cc01cdff83bf0ea4b5de9745ba6b4e140df99059b61bb57f4eaa8d01117a2"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.recoverInterruptedTurn (cognitive 17): Controller.recoverInterruptedTurn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (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":"internal/control/controller.go"},"region":{"startLine":4410}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d584e75a901bf4b5431578fa335d262775d9711c3f93b470e199ee2738d4cac"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.ToolResult (cognitive 17): Controller.ToolResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/controller.go"},"region":{"startLine":5043}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8641aac165c230969a88c1867f21ee8354db5d2ac9aadf0997023e1ef9ccff0"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.providerSwitchText (cognitive 17): Controller.providerSwitchText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/slash.go"},"region":{"startLine":587}}}],"partialFingerprints":{"codehealthFindingId/v1":"a191f69277d839d82ad1cf3849b9c21d52c00f774851760c0896fbe9e667b513"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.RedactSessions (cognitive 17): doctor.RedactSessions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 52). 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":"internal/doctor/session_redact.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"494fd36fd428521d893f50627d9322bc9c49edd2987fed92862f0f437c8c3882"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.contentArgvShowsPath (cognitive 17): evidence.contentArgvShowsPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 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":"internal/evidence/evidence.go"},"region":{"startLine":2383}}}],"partialFingerprints":{"codehealthFindingId/v1":"8378199abfe7814f5a8dce9e1b3c3d55a221416ad251588940f5513fdfe5d2f9"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.commandReviewsChanges (cognitive 17): evidence.commandReviewsChanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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":"internal/evidence/evidence.go"},"region":{"startLine":2457}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f49a9cd175edcb8a964d7a3fc2742a877ca05f03ae13d4e323f11df17804039"}},{"ruleId":"D2","level":"warning","message":{"text":"Ledger.ReceiptProgressSummary (cognitive 17): Ledger.ReceiptProgressSummary 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":"internal/evidence/evidence.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c4c519ec45d34958ef47617558dfd35ce8e301219a3846b14d72e45e4305e3"}},{"ruleId":"D2","level":"warning","message":{"text":"ReviewReport.CoversPaths (cognitive 17): ReviewReport.CoversPaths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/evidence/review_report.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"9be67bf9bd2ca3eba6d3ced4dcbeacde16ae395695b4873e0f7d745f1aed8fab"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.collectExternalizablePointers (cognitive 17): protocol.collectExternalizablePointers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, 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":"internal/extension/protocol/validate.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdd033b0d6f694b6610e6ae8f74f7de5ac375be9e5bd9508a8dd3685c5cfc353"}},{"ruleId":"D2","level":"warning","message":{"text":"providerext.New (cognitive 17): providerext.New has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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":"internal/extension/providerext/providerext.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"158b8c8ccc88865f51f85c1dfc493045557a08e139b908d07d14b76cdeae986d"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.flushLocked (cognitive 17): Resolver.flushLocked 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":"internal/extension/providerext/stream.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"81b5ed449acef39bdd96a21cc65d7d1add75e90e27ab124e248c6446fc39d52d"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.validateHandshakeResult (cognitive 17): Client.validateHandshakeResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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":"internal/extension/sidecar/client.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"1789b5699601f63c81ed1f30785c210054d3e61b5566ebbc11c84eb6c347eef1"}},{"ruleId":"D2","level":"warning","message":{"text":"filelock.Acquire (cognitive 17): filelock.Acquire has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 6, 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":"internal/filelock/filelock.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"c172349b083c7274829d48e1e0cfdaa01407b8a34ca5b298d6665fa125908b53"}},{"ruleId":"D2","level":"warning","message":{"text":"installsource.parseGitHubRepoSource (cognitive 17): installsource.parseGitHubRepoSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 6, loops 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":"internal/installsource/plan.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec14ff3ebe5e34997a2e97cbfaf820e8f0549c4b554f1fbcf3f887321f9ee6f6"}},{"ruleId":"D2","level":"warning","message":{"text":"lsp.parseLocations (cognitive 17): lsp.parseLocations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/lsp/results.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"2680c49fb2e363d8b1bb52fcb62ca3fe9ac8f812bf358c52f417a15653352a3d"}},{"ruleId":"D2","level":"warning","message":{"text":"conn.readLoop (cognitive 17): conn.readLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, match/switch 2, 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":"internal/lsp/jsonrpc.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b112e0c53f0411ca3b79836fbb05a78a2748ac7b216e71b6b307c9680fcc1d5"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.FindOverrides (cognitive 17): memory.FindOverrides has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (nesting depth added 8). Of this number, 16 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":"internal/memory/auto_recall.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"07468593ef9b6166142d0bdff483c041cb546d945314856bf1c09f52e1dd7203"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.AssessRememberWrite (cognitive 17): memory.AssessRememberWrite has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (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":"internal/memory/remember_policy.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c18cc04ea73fa70f8c9f0a7210134eb7d0c51d71fa90fe6937abc6bdf50751"}},{"ruleId":"D2","level":"warning","message":{"text":"migration.dirLooksLikeLegacySessionDir (cognitive 17): migration.dirLooksLikeLegacySessionDir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 4, 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":"internal/migration/migration.go"},"region":{"startLine":539}}}],"partialFingerprints":{"codehealthFindingId/v1":"64ecc61b54f218bd3721b5a2c0d432552610b567c0a6b0d5180ad29a4e5789d2"}},{"ruleId":"D2","level":"warning","message":{"text":"Host.Remove (cognitive 17): Host.Remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (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":"internal/plugin/plugin.go"},"region":{"startLine":1324}}}],"partialFingerprints":{"codehealthFindingId/v1":"55be3ad5a3a9fb79c64a31467d9c6d179f0bd7985858a358b5014393d5084e25"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.canonicalizeSchemaObject (cognitive 17): provider.canonicalizeSchemaObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 4, match/switch 4, boolean chains 1 (nesting depth added 8). 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":"internal/provider/schema_canonicalize.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b6e870af1d9e48267993499ef2bbff4a41318b9960e384641105bb9c05424e8"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.bashRiskBoundary (cognitive 17): recovery.bashRiskBoundary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 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":"internal/recovery/rules.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd3b26538a095e330a13fa35b7b4e7a716765a4d1939f4c4926dd4998b284e62"}},{"ruleId":"D2","level":"warning","message":{"text":"SSHConfigSource.parserEffective (cognitive 17): SSHConfigSource.parserEffective has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 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":"internal/remote/sshconfig.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"b57cf9b4950d874a14cd2f301bea938991f559a795afc9c971641242e4b3f2db"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.verifyRestoredFileUpdateTargets (cognitive 17): repair.verifyRestoredFileUpdateTargets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"internal/repair/update.go"},"region":{"startLine":2734}}}],"partialFingerprints":{"codehealthFindingId/v1":"863703e07b999d741b42f8113bd22bc3c39558c7e8158bebc730e34349f40f2a"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.archiveSupersededAppBundleBackup (cognitive 17): repair.archiveSupersededAppBundleBackup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"internal/repair/update_legacy.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"558129d08e93af86335b4e7ec83f939a8e6df8ac0ba3ea0d163d8d35b9439e02"}},{"ruleId":"D2","level":"warning","message":{"text":"sandbox.writeAllowDirsForSpec (cognitive 17): sandbox.writeAllowDirsForSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, 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":"internal/sandbox/seatbelt_darwin.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"c34e6456ad84cc1fefbaa26354e0be9a08a62f303b32f597613b46f63ddc5ec2"}},{"ruleId":"D2","level":"warning","message":{"text":"serve.historyMessages (cognitive 17): serve.historyMessages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 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":"internal/serve/serve.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7ed188e6f40a98d638ecaedbf95f1de999a010b07ae4eda36140a57193a5389"}},{"ruleId":"D2","level":"warning","message":{"text":"shellparse.IsAssignment (cognitive 17): shellparse.IsAssignment has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 8, loops 1 (nesting depth added 4). 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":"internal/shellparse/bash.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"e78533739508a9dc22f5bb25b01a6d5cac2a51dabfeb55100e32e39c6289c2b7"}},{"ruleId":"D2","level":"warning","message":{"text":"skill.ValidateEditableSubagentProfile (cognitive 17): skill.ValidateEditableSubagentProfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 3 (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":"internal/skill/profile.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5c9a8088f3c5b8d49e2ef8c227ecbb8cefc6f07e4e4e7449229c7ce8bcccf20"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.roots (cognitive 17): Store.roots has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 6, 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":"internal/skill/skill.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"959168a793e8f49d5a9e2d4c25be918bc1d06d9fff3bbb52ad26c5a680b5471c"}},{"ruleId":"D2","level":"warning","message":{"text":"listDir.listRecursive (cognitive 17): listDir.listRecursive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, match/switch 2 (nesting depth added 4). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 98). 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":"internal/tool/builtin/ls.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"74bf819b82adfc50a9b2500cfa614971aa458286f09c502dc4493e4ac6a9c3fb"}},{"ruleId":"D2","level":"warning","message":{"text":"main.findLinuxDesktopEntry (cognitive 16): main.findLinuxDesktopEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 6, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/external_opener_linux.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"f95f789ac68966cb0b77247229d0da85e5f2cd349254740e482c5c4fafe4fb94"}},{"ruleId":"D2","level":"warning","message":{"text":"main.heartbeatTaskDueAt (cognitive 16): main.heartbeatTaskDueAt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4 (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":"desktop/heartbeat.go"},"region":{"startLine":515}}}],"partialFingerprints":{"codehealthFindingId/v1":"aef2501864e0cf95b7ad3688849e0bafbb4d0166c33d6c99fab2fe23f9768765"}},{"ruleId":"D2","level":"warning","message":{"text":"main.asciiSlug (cognitive 16): main.asciiSlug has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, match/switch 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":"desktop/memory_suggestions.go"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"578908346d7ffb20e04cf774ae78adc4abc58ed62103e3f734ffc3c38c5dded3"}},{"ruleId":"D2","level":"warning","message":{"text":"main.validateThemeImageFile (cognitive 16): main.validateThemeImageFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 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":"desktop/theme_image.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5c44c5a46c24a1620fdbfa3726549eef72074678c2de85c342582c264bb4218"}},{"ruleId":"D2","level":"warning","message":{"text":"main.extractThemeZip (cognitive 16): main.extractThemeZip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 3). Of this number, 15 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":"desktop/theme_import.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9c1900983b60b47362838e04547eb97511e4e3d6f6feb366687e459227796a1"}},{"ruleId":"D2","level":"warning","message":{"text":"main.loadOfficialRegistry (cognitive 16): main.loadOfficialRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 5). Of this number, 15 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":"desktop/theme_official.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f36f4a1b730845cafd76daa5a8a1e98be2dd98c4f3c4b923ba6e07e70078f39"}},{"ruleId":"D2","level":"warning","message":{"text":"main.darwinInstalledApplicationIndex (cognitive 16): main.darwinInstalledApplicationIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 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":"desktop/external_opener_darwin.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d1a90d91af10cf5223c887c72fded907409adfc68aa9ca3196a46be22e50410"}},{"ruleId":"D2","level":"warning","message":{"text":"App.ReadFileForTab (cognitive 16): App.ReadFileForTab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (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":"desktop/app.go"},"region":{"startLine":10799}}}],"partialFingerprints":{"codehealthFindingId/v1":"d411d38781faa931b31c098d5dd9f5b33d42c5edb67cddd8cfe73d9e1df3706b"}},{"ruleId":"D2","level":"warning","message":{"text":"App.AttachDropped (cognitive 16): App.AttachDropped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 5). 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 11426). 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":"desktop/app.go"},"region":{"startLine":11424}}}],"partialFingerprints":{"codehealthFindingId/v1":"a29ee8ba947db7977e2017f39a77ba5dfb8adf8574fbff8c2d09487765aa0dcc"}},{"ruleId":"D2","level":"warning","message":{"text":"App.pollFeishuConnectionInstall (cognitive 16): App.pollFeishuConnectionInstall has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (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":"desktop/bot_connection_app.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"2df3eebdd774f2ba94d4da24867b5da72f3d3e5110043a46eed5d8d3664f28ba"}},{"ruleId":"D2","level":"warning","message":{"text":"App.sessionParentLiveForBuild (cognitive 16): App.sessionParentLiveForBuild has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, loops 2 (nesting depth added 2). Of this number, 11 points are the body\u0027s own statements and 5 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":"desktop/session_runtime.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"81750cffcd54eb9fc74a1a7d608ca3b8937a7f4b859bb4a70b9b7feb5cd6eac8"}},{"ruleId":"D2","level":"warning","message":{"text":"App.SaveProviderModelCatalogs (cognitive 16): App.SaveProviderModelCatalogs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2475). 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":"desktop/settings_app.go"},"region":{"startLine":2467}}}],"partialFingerprints":{"codehealthFindingId/v1":"c094ff66a3822c0e61b6fbbc9955f2f2b9478e609e081225394bbac0eb2543d7"}},{"ruleId":"D2","level":"warning","message":{"text":"App.UpdateSubagentProfile (cognitive 16): App.UpdateSubagentProfile 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":"desktop/subagents_app.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6c2520eb7cf195b19d95e223647aae913ac3161f671af5718537e79c03c244d"}},{"ruleId":"D2","level":"warning","message":{"text":"App.installUpdateRequest (cognitive 16): App.installUpdateRequest 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":"desktop/updater_app.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea625522a19e6f17c3da771614b8f9f36ff0301b3eb0e46b03b82448c1f14e7a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.changedLineCoverage (cognitive 16): main.changedLineCoverage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, 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/e2ebench/diff.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"1875781974d2dc6751f10c044f25fd1ebbceb89386ca82c4338de5b47211ec7b"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.deliveryCommandStartsAt (cognitive 16): agent.deliveryCommandStartsAt has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, match/switch 5 (nesting depth added 2). To reduce it, split the body into named stages: move each independent 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":"internal/agent/agent.go"},"region":{"startLine":2200}}}],"partialFingerprints":{"codehealthFindingId/v1":"de72bb692963da7194621dfbdc47ac02afb559c9b13bee0b70207409b7f24ec3"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.migrateLegacyProviderContent (cognitive 16): agent.migrateLegacyProviderContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 2, 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":"internal/agent/preview.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"da30574b2d99aa0bd90424c46033b4ef9549d0c14f4a68a5f006b16f23ad3e80"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.reparentSessionBranches (cognitive 16): agent.reparentSessionBranches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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":"internal/agent/save.go"},"region":{"startLine":1851}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecfd43afe7346be3c6987791a11f009f347e3909b720dbb211f5645d1aed8529"}},{"ruleId":"D2","level":"warning","message":{"text":"agent.repairSessionEventLogTail (cognitive 16): agent.repairSessionEventLogTail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (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":"internal/agent/session_events.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f54a23e7b35ffdd7e2baaed4656b21d58dfd86f2ae916b62cd10672b1b0d035"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.RemoveTaskByCreateToken (cognitive 16): Store.RemoveTaskByCreateToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/autoresearch/store.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"865a45b0c4f935c1311d2ea8e239191db4fb5aa9468b48d9235289ceae0011fa"}},{"ruleId":"D2","level":"warning","message":{"text":"toolSourceConnector.availableSources (cognitive 16): toolSourceConnector.availableSources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"internal/boot/token_profile.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"41dafc19687ed38f7d3b3b7182ff389c0e07bda93a173fb071c8ffd6e6a31e55"}},{"ruleId":"D2","level":"warning","message":{"text":"bot.CreateOrRefreshPairingRequest (cognitive 16): bot.CreateOrRefreshPairingRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2 (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":"internal/bot/pairing.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"f59886e72d1571d1da107db1e13b00c658be79e9708c716dee0bf71496857695"}},{"ruleId":"D2","level":"warning","message":{"text":"BotGateway.runTurn (cognitive 16): BotGateway.runTurn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 4). Of this number, 11 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":"internal/bot/gateway.go"},"region":{"startLine":2073}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8dbabc3c6d036646bb834fc60505fce374cbb397c55f9ada1308d1f35bd5072"}},{"ruleId":"D2","level":"warning","message":{"text":"adapter.pollLoop (cognitive 16): adapter.pollLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/bot/weixin/weixin.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"c30353fe6aca318fa4ecef19699588d4abb21bdba565d3cfa2f58ecc78b609e1"}},{"ruleId":"D2","level":"warning","message":{"text":"botruntime.ChannelConfigs (cognitive 16): botruntime.ChannelConfigs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 2, boolean chains 1, 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":"internal/botruntime/runtime.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"525a8f1630c1593d6ea46f28f809ccd2a9fa19e3292672f42a69fdbe61ef2506"}},{"ruleId":"D2","level":"warning","message":{"text":"botruntime.ConnectionChannelConfigs (cognitive 16): botruntime.ConnectionChannelConfigs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"internal/botruntime/runtime.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a6ea4ca4ccceb4586a1b2585941d98dd37149562caa81a73420ba8d1be5796b"}},{"ruleId":"D2","level":"warning","message":{"text":"capdiag.Collect (cognitive 16): capdiag.Collect 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":"internal/capdiag/collect.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"965f3f19772c3028789b50982dd8e55a5997c7a744e4b11029ece08fec98480a"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.publishTarget (cognitive 16): Store.publishTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"internal/checkpoint/transaction.go"},"region":{"startLine":931}}}],"partialFingerprints":{"codehealthFindingId/v1":"85c6aa2e72b9e2f6223125ea558a93700869a9133963e24c1df7cd22b4fefddf"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.botPairing (cognitive 16): cli.botPairing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/bot.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"6daaa8c0c41a8ce17a02f821d809b506f19a14ac675fd4c0bffe6659a1fd79c4"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.configureKeys (cognitive 16): cli.configureKeys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/cli/cli.go"},"region":{"startLine":2223}}}],"partialFingerprints":{"codehealthFindingId/v1":"28071141d6fdc7746f590707dc32afd0ab76bc07006e35e39aaff3d3756a9560"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.printMCPEntry (cognitive 16): cli.printMCPEntry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (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":"internal/cli/mcp.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"c32e305e4c8d9caf28d7058e531b5b283f05b17cc0df20fbdf7fb8c717716727"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.pastedPathCandidates (cognitive 16): cli.pastedPathCandidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 2). 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: 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":"internal/cli/pasted_path.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30cc0e97c6fffce4b58a867e37dfeef9a1ac8f79fd6cba1e21cca7dfce92f75"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.renderTodoPanel (cognitive 16): chatTUI.renderTodoPanel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 2, 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":"internal/cli/chat_tui.go"},"region":{"startLine":3809}}}],"partialFingerprints":{"codehealthFindingId/v1":"113a4a76f323433231e33d10f09637139f83eeec770ff966ce8620d7c0754378"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.applyMCPMode (cognitive 16): chatTUI.applyMCPMode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/mcp_manager_actions.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"54b9560e28fb339b5119b070e6a75a4002ea0f59785a46f6fd29e75f1a7863c3"}},{"ruleId":"D2","level":"warning","message":{"text":"chatTUI.switchToProvider (cognitive 16): chatTUI.switchToProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 2 (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":"internal/cli/provider.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab067acb3908475d41b363b60d46836f062f78c5631ea0a57d590c4c198ae016"}},{"ruleId":"D2","level":"warning","message":{"text":"mcpManager.renderDetail (cognitive 16): mcpManager.renderDetail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 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":"internal/cli/mcp_manager_view.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"f04b54a0edbe891866cddb4d8ddea9ee3fec6d68ae3f732ed3301cebe52084af"}},{"ruleId":"D2","level":"warning","message":{"text":"mdRenderer.appendInline (cognitive 16): mdRenderer.appendInline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, match/switch 5, 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":"internal/cli/md.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"64f06df0103f58c268f8439c4cd9615a51f4fb6d914ce3bd5877408f9a1a6fa7"}},{"ruleId":"D2","level":"warning","message":{"text":"command.walkCommands (cognitive 16): command.walkCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 2, 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":"internal/command/command.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"30c581b8b0a1a4f323bb4fb4adbfd86418eb03bff5341b12a41392307966b295"}},{"ruleId":"D2","level":"warning","message":{"text":"config.lookupLegacyKeyringBatch (cognitive 16): config.lookupLegacyKeyringBatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/config/credentials_keyring_helper.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f0aa7a02810e406b744e74feedca0d89a5ba92b5286cc6ea8c5fa775f4b7cae"}},{"ruleId":"D2","level":"warning","message":{"text":"config.ClearPluginAuthenticationInSourceForRoot (cognitive 16): config.ClearPluginAuthenticationInSourceForRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"internal/config/edit.go"},"region":{"startLine":913}}}],"partialFingerprints":{"codehealthFindingId/v1":"db2900f4643697778acf1b8e78b20dde211ce13b407306a25ad1a66567ac89a2"}},{"ruleId":"D2","level":"warning","message":{"text":"config.mergeTOMLPlugins (cognitive 16): config.mergeTOMLPlugins has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/config/load.go"},"region":{"startLine":466}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ecea2f9f9aaf357aba12b600f6166cd03c6b9dbc30e678a916f870ecf8eabcf"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.ResolveSystemPromptForRoot (cognitive 16): Config.ResolveSystemPromptForRoot 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":"internal/config/config.go"},"region":{"startLine":2175}}}],"partialFingerprints":{"codehealthFindingId/v1":"12cdea106a862b0329977bbfd8def60159c62ac0048b0821de6f42f5a9f08bf8"}},{"ruleId":"D2","level":"warning","message":{"text":"control.parseRefTokens (cognitive 16): control.parseRefTokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/refs.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"07e9bf5de6266d242503b388e7c187717f3e060ff6111f17bed09ed904efc517"}},{"ruleId":"D2","level":"warning","message":{"text":"control.mcpArgItems (cognitive 16): control.mcpArgItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/slash.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c82ca6858c21e5a64372b135cfe7c394f77fd350a45d1785b7225625650c228"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.submitInvocations (cognitive 16): Controller.submitInvocations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 4). Of this number, 15 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":"internal/control/controller.go"},"region":{"startLine":1251}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee8e7363ae499041607f1f35c6c4e530f7dc75da1a9cb6f22a91e04bd1b05ef0"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.ListExternalFolderRefDir (cognitive 16): Controller.ListExternalFolderRefDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/control/refs.go"},"region":{"startLine":353}}}],"partialFingerprints":{"codehealthFindingId/v1":"9077782fc8e5926b93bb45d8f303a474815d19cb8b6bcf1273ba0aba73aab480"}},{"ruleId":"D2","level":"warning","message":{"text":"doctor.RenderText (cognitive 16): doctor.RenderText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 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":"internal/doctor/report.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf0fa2be75e0b6dbaf058d67e9329ec091cf9b0408c255096a0abf1e49e61d16"}},{"ruleId":"D2","level":"warning","message":{"text":"evidence.completeStepHasProof (cognitive 16): evidence.completeStepHasProof has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, match/switch 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":"internal/evidence/evidence.go"},"region":{"startLine":2592}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5775026e6ad39654270e7a2a825e6afc670e466b690441447b78639fe230cc2"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.buildObjectSchema (cognitive 16): protocol.buildObjectSchema 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":"internal/extension/protocol/schema.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"891f524bfd792b92bf3fa0391c52ebb0c685c1fff00fa50e3f3964f98e6ad364"}},{"ruleId":"D2","level":"warning","message":{"text":"protocol.applyFieldTags (cognitive 16): protocol.applyFieldTags has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/extension/protocol/schema.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"48989657dfd7cdc01d1951649bb435e4266e6d8c395e0fa5eea2c3c052e6612c"}},{"ruleId":"D2","level":"warning","message":{"text":"installlayout.validateMembers (cognitive 16): installlayout.validateMembers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, 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":"internal/installlayout/activate.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a103a0da4c2f4f1272a0ace0efffeb3d1b8025acc9706b5524eb0154e0a438b"}},{"ruleId":"D2","level":"warning","message":{"text":"installlayout.stagingNonce (cognitive 16): installlayout.stagingNonce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, loops 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":"internal/installlayout/activate.go"},"region":{"startLine":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"a05823821b004cfa3c2e2b1551c42000cecf0681070515f62543d951062f9d55"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.applySkillRoot (cognitive 16): installSourceTool.applySkillRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 15 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":"internal/installsource/apply.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"04109beb039d24aa146ac0e01ea1260be327e51acf070c2dfa0321ba9f1b9fcb"}},{"ruleId":"D2","level":"warning","message":{"text":"installSourceTool.uninstallActionsForScope (cognitive 16): installSourceTool.uninstallActionsForScope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, 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":"internal/installsource/install_source.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3593b95b54266ba347b9bae038bd0711f6b0df2ca80e4dd1fd5ae386bb6553e"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.adoptUnscopedJobsLocked (cognitive 16): Manager.adoptUnscopedJobsLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, 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":"internal/jobs/jobs.go"},"region":{"startLine":1316}}}],"partialFingerprints":{"codehealthFindingId/v1":"a23b21d7d37105510ffff06906fa83e9355a7f3a17557d7673e318faf2161dd8"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.flushIndexIn (cognitive 16): memory.flushIndexIn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, 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":"internal/memory/store.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c377ea6fc26dad481fc56bce8059ab731897ecfa1df165c81231b86d05c0f9e"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.MatchedRule (cognitive 16): Policy.MatchedRule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, 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":"internal/permission/permission.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"8506cab3474f640d1482c8d8634831aa9884d5b0502f9a2ccf7fb45ea442020b"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.resolvePyPIPackage (cognitive 16): plugin.resolvePyPIPackage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 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":"internal/plugin/launcher_lock.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"84d1854c7e29c5e6d989ec4a213ba7bb50bfa028b0b9ac9410d987d171b3c4e2"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.resolveStdioExecutable (cognitive 16): plugin.resolveStdioExecutable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"internal/plugin/transport_stdio.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e438953ebf1d9b88d225c13d29e2b770a6b8bc20b466ecc54388a4168cc40bb"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.listTools (cognitive 16): Client.listTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/plugin/plugin.go"},"region":{"startLine":1685}}}],"partialFingerprints":{"codehealthFindingId/v1":"12876302aa247197b17dadd5018e6ad383f45bdf4e7e75e2e102239364e6084f"}},{"ruleId":"D2","level":"warning","message":{"text":"productdocs.renderReleaseItemBullets (cognitive 16): productdocs.renderReleaseItemBullets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, 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":"internal/productdocs/release_notes.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"445b465db50a7050ac45040faf9a14008c5ac48bd100cf16cfa0b31c3ae93333"}},{"ruleId":"D2","level":"warning","message":{"text":"provider.closeTruncatedJSON (cognitive 16): provider.closeTruncatedJSON has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 6, loops 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":"internal/provider/provider.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c59e38a90aefc0a564caac8f05c5e372af01f14184e9d50ffb5aa280cee1325"}},{"ruleId":"D2","level":"warning","message":{"text":"recovery.ghTaskGrantBoundary (cognitive 16): recovery.ghTaskGrantBoundary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 6, match/switch 2, loops 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent 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":"internal/recovery/rules.go"},"region":{"startLine":777}}}],"partialFingerprints":{"codehealthFindingId/v1":"77332c2c14692697a03b4fef7925d4cbf00b8d74622cfb577017ba36ab09c11a"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.preparedRepairChangeApplied (cognitive 16): repair.preparedRepairChangeApplied has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"internal/repair/transaction.go"},"region":{"startLine":742}}}],"partialFingerprints":{"codehealthFindingId/v1":"bace80c747cb2d2f1deaae029ffb00624c7d70f1c4b8758d19a8fa5eb5af2b38"}},{"ruleId":"D2","level":"warning","message":{"text":"repair.cancelPendingAppBundleUpdateHandoff (cognitive 16): repair.cancelPendingAppBundleUpdateHandoff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. 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: 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":"internal/repair/update.go"},"region":{"startLine":1197}}}],"partialFingerprints":{"codehealthFindingId/v1":"be731340856119d818c9a598557e42293fc31168adac30d6b4839587f26740f7"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.submit (cognitive 16): Server.submit 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":"internal/serve/serve.go"},"region":{"startLine":692}}}],"partialFingerprints":{"codehealthFindingId/v1":"929b7d0b84f6a557d3b3f6c0281858e71deeeb7d6943a01331201a9b81068e8c"}},{"ruleId":"D2","level":"warning","message":{"text":"skill.ResolveSlashSkill (cognitive 16): skill.ResolveSlashSkill has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/skill/skill.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"d35b560fe680c412f85cce4f88a3e80d0e6fdc171f8f83419487a70636eb46b1"}},{"ruleId":"D2","level":"warning","message":{"text":"TaskRecorder.RecordDone (cognitive 16): TaskRecorder.RecordDone has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"internal/taskmonitor/recorder.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"39d37a1ab9fbcc14b8cc96b11da9ad05371213f51d4a3afc5289c73f7918dd10"}},{"ruleId":"D2","level":"warning","message":{"text":"telemetry.installID (cognitive 16): telemetry.installID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"internal/telemetry/client.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d7ee9e6bba436963b370a535cdb66158d93491baff16353b97e27a1c5dc017f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtin.renderPostWriteReceipts (cognitive 16): builtin.renderPostWriteReceipts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"internal/tool/builtin/post_write_receipt.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd422dcbac25cd6627b5a733eb20c665cbd91cdcfca0e1f37cfdc98c8354833f"}},{"ruleId":"D2","level":"warning","message":{"text":"conn.serve (cognitive 16): conn.serve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, loops 1 (nesting depth added 7). 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":"sdk/go/wire.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"d54343850979c7faa43d44632946fdc9ed560baba0e7a41332b6a19061e58a98"}},{"ruleId":"D2","level":"warning","message":{"text":"compareSemver (cognitive 16): compareSemver has cognitive complexity 16 (threshold 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":"npm/publish.mjs"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"c70245e8eb0a8dae06e8c2a209606a3f5b91a66f70d6fd4aa71c4929d2ebb50f"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: App: TooManyMethods \u2014 794 methods, declared across 45 files: desktop/app.go (320), desktop/tabs.go (122), desktop/settings_app.go (94), desktop/remote_app.go (30), \u002B41 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":"desktop/app.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"b842e9c7a79df021365a9b9e27c9091d17a5d7cded684d6b2c274b70fd01a677"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/app.go: FileTooLong \u2014 8072 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":"desktop/app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"73300f915e0ba7fdaffb7d85b8667544efbbf633f8610724ee0a6a7ae09627de"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/tabs.go: FileTooLong \u2014 6325 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":"desktop/tabs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ca43a07ae49952df9df91609a701176835cbe52db54f1743adeb5ddfe367a9d"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Controller: TooManyMethods \u2014 342 methods, declared across 14 files: control/controller.go (261), control/recovery.go (14), control/refs.go (14), control/input.go (12), \u002B10 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":"internal/control/controller.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"8340d6deba2378402feb1827b4c556e6441d7fda4e60eef636040f428433fcdd"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: chatTUI: TooManyMethods \u2014 296 methods, declared across 39 files: cli/chat_tui.go (87), cli/complete.go (24), cli/transcript.go (19), cli/composer_selection.go (15), \u002B35 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":"internal/cli/chat_tui.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"dadd43825a5517db7a4d9e58e25ea24c9464b0d468ff6d0442e306cafc1953ef"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: control/controller.go: FileTooLong \u2014 3875 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":"internal/control/controller.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ea50c101b2ad154d522afd77e083c1ab2c60212162263a99bbb58bfa1ebdab7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/chat_tui.go: FileTooLong \u2014 3267 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":"internal/cli/chat_tui.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e36e7bef7cd12133b9e016b2cf7ca7f40b43d660e7658cec3f430aa2bf1c8bd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/settings_app.go: FileTooLong \u2014 2546 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":"desktop/settings_app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e0f68eaeef8f7ac4f097c3972dc6de9bcd93a574706d7944c5be5e5e93291f5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/agent.go: FileTooLong \u2014 2482 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":"internal/agent/agent.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c0fea7ea30aa38656d040affef06419a9a2a334d0ca3166133386621abe4e70"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Config: TooManyMethods \u2014 138 methods, declared across 9 files: config/config.go (67), config/edit.go (55), config/pricing.go (5), config/plugin_packages.go (4), \u002B5 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":"internal/config/config.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"5612c589908c444c25044d853b8863b9c91723d625737c994cf8dbf365c7d074"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Agent: TooManyMethods \u2014 136 methods, declared across 12 files: agent/agent.go (74), agent/compact.go (15), agent/execute_one.go (10), agent/extensions.go (9), \u002B8 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":"internal/agent/agent.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"a23dcc41ffbc86e38d2cb9bb8f97c224b0a143e1c9b83cb9809255271eee4c02"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: repair/update.go: FileTooLong \u2014 2233 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":"internal/repair/update.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bec5348b453931187ed394d9bb81235ac66f689c94488deb0b2f621cabdb4b06"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: bot/gateway.go: FileTooLong \u2014 1995 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":"internal/bot/gateway.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1197dcc4d03d184bae463a154d4b852d56e2ca6b9fcde4e32fa8545d09b6010c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: boot/boot.go: FileTooLong \u2014 1874 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: build (210-2145). 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":"internal/boot/boot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8029ac597072fd033921463a18789f7be02dd5b5b322847d55b7239a0519a225"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: acp/service.go: FileTooLong \u2014 1872 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":"internal/acp/service.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"86980447fcb1203f19a7b64e606ea02f169d5e78aeb50db9b608cd50ceb566f1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/cli.go: FileTooLong \u2014 1777 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":"internal/cli/cli.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8bd12eb2483fa26814d9602604a816f72a7a04d4d921fc6a678680636775db6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: evidence/evidence.go: FileTooLong \u2014 1711 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":"internal/evidence/evidence.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f6cbd00d1e3f54a09897ad34965783e30beab37949fcf43eccd9e7c5aa9310d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/edit.go: FileTooLong \u2014 1525 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":"internal/config/edit.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"198cdf8771c4bb80e4495b6c37e1e5c52e796c3bef9223da0c5422fdaf258ab9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: BotGateway: TooManyMethods \u2014 83 methods, declared across 4 files: bot/gateway.go (72), bot/control_server.go (7), bot/desktop.go (2), bot/project_index.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":"internal/bot/gateway.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"5383a1ce9d49398c4d5ea5c900f15a4b980d5bc5ce488efc792ff3da4919bb3e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: jobs/jobs.go: FileTooLong \u2014 1296 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":"internal/jobs/jobs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"24e04c05f552ba8ebb468e75597a55a572c4380ec7fb15208d8f1ec2df3173e1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/load.go: FileTooLong \u2014 1258 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":"internal/config/load.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a625e441469ac771dcbb136c3799a5592c5f0cdd0fff0c22a6e16da12f3e60d1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/render.go: FileTooLong \u2014 1256 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":"internal/config/render.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4055cb93027f0b15ad5bd132454c83dbefba3377eded9690c4d7d0a8ee15b675"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/task.go: FileTooLong \u2014 1255 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":"internal/agent/task.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"02c0d3d7a8d7a6b9392343377477cb9f62365728b1937a327fa3da53243d004a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: plugin/plugin.go: FileTooLong \u2014 1234 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":"internal/plugin/plugin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"76275adda2cacd2448f4baff4b1434acb672d78820fe61aa2ca6c80a324949bc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/config.go: FileTooLong \u2014 1232 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":"internal/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f55f5c9b7f232b4454852d318af718c59d65dc567702cb1ab21eb7ba1fa99b1c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: checkpoint/transaction.go: FileTooLong \u2014 1223 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":"internal/checkpoint/transaction.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4539ffe7f4589ffb379742d91c5870c401c7f0fd3251e8982f7f5a18b2ae4f0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/save.go: FileTooLong \u2014 1207 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":"internal/agent/save.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2ede1601d4b4497d16f3173cf4cd6ac5a66660c87376060a4d003352c31e486"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Store: TooManyMethods \u2014 68 methods, declared across 2 files: checkpoint/transaction.go (36), checkpoint/checkpoint.go (32). 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c5d4daf24f1e4f9af8e9eaf24bc853ffb25ea5af98af909847c3c2831129c80"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/remote_app.go: FileTooLong \u2014 1120 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":"desktop/remote_app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d41d569502a821b1be70c62484c18833bb9366c79801d2cfa479839826032497"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: serve/serve.go: FileTooLong \u2014 1010 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":"internal/serve/serve.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ec5ab16b15155c83ad86bff823a3cb68ef535fadda7392b5be2adc25a419930"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/usecapability.go: FileTooLong \u2014 1001 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":"internal/agent/usecapability.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f793b6d004c8873ae9ce3f6db063a69a348e524c03109057aed3969b784ddd6a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: hook/hook.go: FileTooLong \u2014 988 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":"internal/hook/hook.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f51cb8746c5f43af082086cfb1c9ec5c6f583a14e3a114146f7f5cecdf7bbe22"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: recovery/gate.go: FileTooLong \u2014 959 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":"internal/recovery/gate.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e134f790d566bff4f51d8e9a62f26e1275f0320900e6f7750efbd350bb972d8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Server: TooManyMethods \u2014 57 methods, declared across 2 files: serve/serve.go (50), serve/provider_setup.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":"internal/serve/serve.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"b872eee48f093a49b9843081231ea159a5027536229ff6cf4764c876930b42c7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/updater.go: FileTooLong \u2014 934 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":"desktop/updater.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"79f191c55f4ad13424c4df08ca8f4a729f7b42782dec2acddc38306a70fa35f5"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: installSourceTool: TooManyMethods \u2014 55 methods, declared across 7 files: installsource/install_source.go (16), installsource/apply.go (10), installsource/plan.go (10), installsource/plugin_package.go (8), \u002B3 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":"internal/installsource/install_source.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"543c728aaf5458db8a56df36ca3364f498ef341ac94db6079bf479f614987cd3"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Manager: TooManyMethods \u2014 55 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":"internal/jobs/jobs.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"d77da2fbfc666415eb6e7e447560fe20240e0a3b2fb29f6fed7dca3279a79b34"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: service: TooManyMethods \u2014 53 methods, declared across 2 files: acp/service.go (49), acp/status.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":"internal/acp/service.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"6feda3fa3598c6f18f454ff4f3cceb4f8160ac8b058ba759fbcb51a75d29dad1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: skill/skill.go: FileTooLong \u2014 879 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":"internal/skill/skill.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ecd6367c593a6ee75947e43a22a659b6f8c463fe858b27128fa6fa59c8686d9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: control/refs.go: FileTooLong \u2014 860 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":"internal/control/refs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"708d1a759357059d5798bbfc799dc43c50cf57c6ad397e5e1a13a4c4031515e4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: openai/openai.go: FileTooLong \u2014 857 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":"internal/provider/openai/openai.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd04d3a6abe1559bb4725ff6eb6153fe56bca6dedc90e725e4597e696f05ebb5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/provider_presets.go: FileTooLong \u2014 849 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: curatedProviderPresets (185-978). 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":"internal/config/provider_presets.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"26631afb311c373918f64a606aa8cfcfc6918a4140c6ca802545e2e1245af6ac"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/sessions.go: FileTooLong \u2014 846 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":"desktop/sessions.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9774cf093aa988a403e22207b38b35da7af7ea70726c418c296abf0828767ed7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: pluginpkg/pluginpkg.go: FileTooLong \u2014 809 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":"internal/pluginpkg/pluginpkg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba663ab890c4eabe713055a4e3eeac543202874f25969a1039ac24f449b2ce2f"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Ledger: TooManyMethods \u2014 48 methods, declared across 4 files: evidence/evidence.go (39), evidence/review_report.go (4), evidence/child.go (3), evidence/risk.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":"internal/evidence/evidence.go"},"region":{"startLine":376}}}],"partialFingerprints":{"codehealthFindingId/v1":"0437bd4335ccf2b7b24ca9d75d0b701ec461554ed6e7502824965377020789a7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: control/goal.go: FileTooLong \u2014 779 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":"internal/control/goal.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e85a477029d7d95e93c9b3374889ecc8f2012b5164f1f38c3670923252172c13"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/bot_connection_app.go: FileTooLong \u2014 740 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":"desktop/bot_connection_app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"25ca84e28777b0db8827660cee000512c1737cf33e3752223c72316f8d426df1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: checkpoint/checkpoint.go: FileTooLong \u2014 720 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":"internal/checkpoint/checkpoint.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"00b77585cab876fef8297b55c230920b37c49369d7794390bad2af8b0b75bc13"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: autoresearch/store.go: FileTooLong \u2014 699 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":"internal/autoresearch/store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ced36e06015232beea3487f353397a69725ef45982f610c5b63006319c62da46"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: feishu/feishu.go: FileTooLong \u2014 689 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":"internal/bot/feishu/feishu.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"10306440412f65d4ecbb2df2369b37ba8233d1d5d1212e82b20400f7fc815659"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: adapter: TooManyMethods \u2014 41 methods, declared across 4 files: feishu/feishu.go (28), feishu/inbound.go (6), feishu/outbound_media.go (6), feishu/outbound.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":"internal/bot/feishu/feishu.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"f207c9bd011f3eb177feeaf23bb77222425493456980fe64811e37815307da72"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: recovery/rules.go: FileTooLong \u2014 681 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":"internal/recovery/rules.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4cf0cd74ee65ecf901ea479cdc919d95c43e63aa1c3fc013c17c8b53569db08"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TaskTool: TooManyMethods \u2014 40 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":"internal/agent/task.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"26ecb71d7804c4cd39fabb4a5276512f2c6eb1b7a5aa448503a338fd3fdbcc6e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Host: TooManyMethods \u2014 40 methods, declared across 2 files: plugin/plugin.go (38), plugin/install.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":"internal/plugin/plugin.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ac9e689f9113e26950a016e5fe1e2cd3cfb9e30aca5d0eea34483fed10b23e5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: go/sdk.go: FileTooLong \u2014 666 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":"sdk/go/sdk.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2be85240145da5a5bc45f7a31377b5e49349ff503229fd6383a7200ef061c78a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/subagent_store.go: FileTooLong \u2014 643 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":"internal/agent/subagent_store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c74491d516d531a01c4b4767e7f2604157cafa9ecd5f98d154e6a839e2012aa6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/setup_manager.go: FileTooLong \u2014 636 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":"internal/cli/setup_manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bf2c8b0112827c2f01b36bdd0024c37abe9112c1e480adcbfc7ba56ebbc82b2"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Client: TooManyMethods \u2014 38 methods, declared across 2 files: sidecar/client.go (35), sidecar/externalize.go (3). 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":"internal/extension/sidecar/client.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"8207ae3179e8f7922bd1d3cc0dbe024f781dafef2e8aa2fdc93b1a39b7738f2b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/terminal.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":"desktop/terminal.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"322028bb34c6b688a38a65f99beb6349840842b2dd8a1c9cfe8c9a71e8d2011f"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Gate: 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":"internal/recovery/gate.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"87e7b81646bd850a13c958fc6f37771a2e4b7fac77ccde14585ea8a226808a82"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/coordinator.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":"internal/agent/coordinator.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"562c3bde92c3b73dfaca71ae8ed6b7e8f0cfcfeb7404df589abfd4967f84abae"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: desktopRemoteManager: TooManyMethods \u2014 36 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":"desktop/remote_app.go"},"region":{"startLine":628}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbf196dd5c6eeca5806a48ee7a6ec1ce169a37d993c288771fd8558a4a7504ce"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/migrate.go: FileTooLong \u2014 600 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":"internal/agent/migrate.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f60772b6529d2dbbb91689b716342b2f23c7327694c1df8ef029f9693e3dbdef"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/mcp.go: FileTooLong \u2014 594 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":"internal/cli/mcp.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c99cbd427424f856b80de3f93476e0e87cf3475e50bc59052524ba3e02cf3867"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: i18n/i18n.go: FileTooLong \u2014 593 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: Messages (26-616). 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":"internal/i18n/i18n.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4760e174dc4d406b63e5538c99baebd58d51a63d5384deef1d344ae5b6f0d33"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: repair/plan.go: FileTooLong \u2014 589 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":"internal/repair/plan.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"11ee115fa722dc824bcc5d5b34b33eed57104ce7ee959d7776bb4054fcaaabec"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: bot/project_index.go: FileTooLong \u2014 587 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":"internal/bot/project_index.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4a3a22257267a696394e4aca17a3f21b35e7bf31b4727a7676b946a8c0ea993"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: capdiag/collect.go: FileTooLong \u2014 574 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":"internal/capdiag/collect.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6df5c4e6d4835f275b5210ba4465505a5b22c1a04eb416ba1b9fe663292e475a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: responses/responses.go: FileTooLong \u2014 572 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":"internal/provider/responses/responses.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a68d76c040b21ea4e2253c4797a1ebcd7981499f189d214c80ac1231be239ef1"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: goalMachine: TooManyMethods \u2014 34 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":"internal/control/goal.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2477aae6ab1cad003343e772a75e10804387b42cd210a392f91f4f47e69ebd6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/session_events.go: FileTooLong \u2014 560 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":"internal/agent/session_events.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"474ccb2a15dd6ae444836c2101bc16c3edb2cda176d09257d7dd993c2e922ad4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: productdocs/docs.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":"internal/productdocs/docs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"238f3ee9d40bd7a77b92627334a404ba536dd9234f53cbd03fa17c9656ac1563"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/credentials.go: FileTooLong \u2014 554 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":"internal/config/credentials.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c0a873e77bd7401b086cedf49ce138945cdca0d72679f9b1a0c6a6eb1a050e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: qq/gateway.go: FileTooLong \u2014 551 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":"internal/bot/qq/gateway.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"98e446c5ddbf639908a3a4cefbedb58156f23e2005577338e2191c6944e21dfe"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: anthropic/anthropic.go: FileTooLong \u2014 551 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":"internal/provider/anthropic/anthropic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"462d49611940a842b20c66ecc8a06a1f650d636c2445ab97dba32e426fd13b99"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: approvalManager: TooManyMethods \u2014 33 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":"internal/control/approval.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bb62bd0d21f3a68229921343254ecec5266e2baedc7c172f20e0c7c818bbc41"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: rpcwire/conn.go: FileTooLong \u2014 545 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":"internal/extension/rpcwire/conn.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4366ad21cc6c7ff3dcf2dfebd215ea0171fa9ebcd245bd3ec292b9104e6b694"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/heartbeat.go: FileTooLong \u2014 544 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":"desktop/heartbeat.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e75b239f55e7ef76a620f75da064689f5465fee914e77df4de09849724e223cc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/updater_mac.go: FileTooLong \u2014 541 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":"desktop/updater_mac.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"86bc0da432a5daa5d1684897a5362e01e10b6b7f033e3374200903408200e49f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: provider/provider.go: FileTooLong \u2014 540 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":"internal/provider/provider.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"89cb5327a79d48608aa0fe1830819eae2615cd339d38d0eb7d05401b1c32a36d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: permission/permission.go: FileTooLong \u2014 538 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":"internal/permission/permission.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed2c1f150a72aef45ae6745918cfaf654b7fdddc869bef37205b80e37ddf11b8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/migrate.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":"internal/config/migrate.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cfc002b40b68488d6cc6f2c46a5320353488f19a602fe39c6ca1f43781f6986"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: memory/store.go: FileTooLong \u2014 534 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":"internal/memory/store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9daaed5c1415aac27465c53cbf442f458f62de5a57ded69aa619da7c70c6d317"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Session: TooManyMethods \u2014 32 methods, declared across 2 files: agent/save.go (16), agent/session.go (16). 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":"internal/agent/session.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7b365cdc8e045b60551d72bfd63fc911c9b1cdde9955e0b75fde87132e755b9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: acp/status.go: FileTooLong \u2014 533 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":"internal/acp/status.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b99ee1b1edfaa7ae4b048c9f371048a6156d53daa75adfd5c4dc433f3891391"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/remote_connect.go: FileTooLong \u2014 526 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":"internal/cli/remote_connect.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b212ec28aa23fd3453db7db003b8dd066a3debac5b618622a345049eb926c59"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: desktop/theme_app.go: FileTooLong \u2014 522 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":"desktop/theme_app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3d54e0f87303659c5307865dd27ec97e962eb5a6df381ad9a6361376fad7d5b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: agent/execute_one.go: FileTooLong \u2014 511 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":"internal/agent/execute_one.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2e96aa86ed275fb9ed0fe1853d37b150f0b4794f6821030fa28bd99c39501b8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: botruntime/runtime.go: FileTooLong \u2014 511 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":"internal/botruntime/runtime.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"429d8533b372e0bb3fafc7a764ca71bdc39418614e959418fb2ca2f5449f7ace"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/transcript.go: FileTooLong \u2014 510 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":"internal/cli/transcript.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1866c2fac402a48a6d2add839b61740b6c8faa5fbc59cb73b1162e6853519a0c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/complete.go: FileTooLong \u2014 507 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":"internal/cli/complete.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec6bbf3d2eb86d167eb45a88ae04598f770b3bed166bdffa0af8069861f39019"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: repair/transaction.go: FileTooLong \u2014 502 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":"internal/repair/transaction.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"398f39284999d99205648d51c0a2a5997eaa44b78a02dfa91c700dfd2990275d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cli/skill_picker.go: FileTooLong \u2014 501 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":"internal/cli/skill_picker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"949fe67a36c487d4ce405673c56be70c36670781610d881ecfc1b37e78835ac7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: plugin/transport_stdio.go: FileTooLong \u2014 501 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":"internal/plugin/transport_stdio.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c14c83bea7320b2f9550c0310e729904e2df79ca8dc10536589dd54cc0021805"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): desktop/deferred_rebuild.go:207-226 | desktop/deferred_rebuild.go:257-276 \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. 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":"desktop/deferred_rebuild.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"3021ba1bb8721981e480e967d11e3ec319f864fba15877c4ee04f423cfcb5496"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): desktop/settings_app.go:2952-2970 | desktop/settings_app.go:3090-3108 \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 \u0060desktop/settings_app.go:2952\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":"desktop/settings_app.go"},"region":{"startLine":2952}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdbfbf26bfb11dbeb9e180eddb7e3ac103fc6ad3d9f43c156101f8cbaf10583c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): internal/cli/select.go:244-260 | internal/cli/select.go:471-487 \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 \u0060internal/cli/select.go:244\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":"internal/cli/select.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc7aaff2af031bbd75ddfa7f7da4d012681c9a92b4bbfd84ff3d3dfc31405ce5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 3): desktop/cmd/update-helper/authenticode_windows.go:29-44 | desktop/cmd/update-helper/main_windows.go:404-419 | desktop/updater_windows.go:226-241 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/cmd/update-helper/authenticode_windows.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"cef4d98705d06955ae80880408129f750a4e55e730c89350164751f47be50712"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): desktop/subagents_app.go:163-178 | desktop/subagents_app.go:225-245 \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 \u0060desktop/subagents_app.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/subagents_app.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd29aa12b47043459fbcbfb1b0b02934dcc069f3c1b46a23030c69bc39fe0275"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): internal/cli/select.go:87-102 | internal/cli/select.go:273-288 \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":"internal/cli/select.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb98c5dce5b4d4a232467590a9e0d5f63e75f258eafbca1b95e05ac91ce70569"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): desktop/app.go:5671-5684 | desktop/app.go:6022-6035 \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 \u0060desktop/app.go:5671\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":"desktop/app.go"},"region":{"startLine":5671}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e437896fb95e65c1d3100266fd2f59faa08f5bccfc4940df2fcf2c2d0db24bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): desktop/app.go:10100-10113 | desktop/app.go:10272-10285 \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 \u0060desktop/app.go:10100\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":"desktop/app.go"},"region":{"startLine":10100}}}],"partialFingerprints":{"codehealthFindingId/v1":"2565f9ed283d0b07c9d079a04fc480b4774cb4175ddf3cb07f3f7d5395267fa8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): desktop/app.go:10273-10286 | desktop/app.go:10413-10426 \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 \u0060desktop/app.go:10273\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":"desktop/app.go"},"region":{"startLine":10273}}}],"partialFingerprints":{"codehealthFindingId/v1":"20ab9ea2fb29be31b2588124b08eedc13bacb94cf1a749123f5491772e5e944d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): desktop/tabs.go:9004-9017 | internal/doctor/session_bundle.go:318-331 \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 \u0060desktop/tabs.go:9004\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":"desktop/tabs.go"},"region":{"startLine":9004}}}],"partialFingerprints":{"codehealthFindingId/v1":"51bd2d1bb5c38f5a76811e90e109ac120bef673cd0a55790f7fd6a9f3b4e46bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): desktop/updater.go:1014-1027 | internal/cli/upgrade.go:647-660 \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 \u0060desktop/updater.go:1014\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":"desktop/updater.go"},"region":{"startLine":1014}}}],"partialFingerprints":{"codehealthFindingId/v1":"5562945f78ea1a8033e50437ae46142da28f3ebb7fe4b5aa620808b4c52b164d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): internal/cli/select.go:183-196 | internal/cli/select.go:367-380 \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 \u0060internal/cli/select.go:183\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":"internal/cli/select.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"61868a57900d678c00c8ed2737a05ee89a910c1d020effee1096967884d50d6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): internal/config/mcp_activation.go:111-124 | internal/config/mcp_activation.go:136-149 \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":"internal/config/mcp_activation.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5457ad488b7b9c873441ac99d06b3d45d6d4c305c1bb3969bfa090e74c3ed32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): internal/extension/sidecar/process.go:81-94 | internal/plugin/startup.go:69-82 \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 \u0060internal/extension/sidecar/process.go:81\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":"internal/extension/sidecar/process.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1302575194d703a053c1be1ded2b23de9612ad2c00425839d3a2fd67744145"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 4): internal/agent/branch.go:228-240 | internal/agent/save.go:414-426 | internal/agent/session_events.go:873-885 | internal/agent/session_lease.go:294-306 \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 \u0060internal/agent/branch.go:228\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":"internal/agent/branch.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"01bf0a0bbbecb2437c7b7d152fbf433749eeb858274f5f984113c1f4dd30cb7b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): desktop/app.go:2182-2195 | desktop/app.go:2298-2310 \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 \u0060desktop/app.go:2182\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":"desktop/app.go"},"region":{"startLine":2182}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c91e0b4d320633ad735ebddfd6429c8b0511ee57480ede9a1e39eca32a6f15e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): desktop/app.go:10310-10322 | desktop/app.go:10449-10461 \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 \u0060desktop/app.go:10310\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":"desktop/app.go"},"region":{"startLine":10310}}}],"partialFingerprints":{"codehealthFindingId/v1":"30b9b57cd0bc0ffaafe5f9ee80953dba96c7e510155b75a905d11574c5d9513e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): desktop/settings_app.go:2588-2600 | desktop/settings_app.go:2648-2660 \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 \u0060desktop/settings_app.go:2588\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":"desktop/settings_app.go"},"region":{"startLine":2588}}}],"partialFingerprints":{"codehealthFindingId/v1":"47175dfae913916b36b5fc49e760284d193fdae8ca1ad20f5710be3370a3f26c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): desktop/settings_app.go:2882-2894 | desktop/settings_app.go:3016-3028 \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 \u0060desktop/settings_app.go:2882\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":"desktop/settings_app.go"},"region":{"startLine":2882}}}],"partialFingerprints":{"codehealthFindingId/v1":"3506d7f0cad1b3bb7a71ca25de9f556f4cf5a6e79b626b39e91bba01900c22cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): internal/agent/migrate.go:855-867 | internal/environment/snapshot.go:87-99 \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 \u0060internal/agent/migrate.go:855\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":"internal/agent/migrate.go"},"region":{"startLine":855}}}],"partialFingerprints":{"codehealthFindingId/v1":"2da4e736506ea5ca1d716fe72192405bfd58aa168e080d84ea36e4b66818887e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): internal/cli/select.go:163-177 | internal/cli/select.go:349-361 \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":"internal/cli/select.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"31e2902cb1e3e686ecb4a994088e61fbc0173af2271e7c679032ff64d6c47e73"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): internal/evidence/evidence.go:1430-1442 | internal/evidence/evidence.go:2680-2692 \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 \u0060internal/evidence/evidence.go:1430\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":"internal/evidence/evidence.go"},"region":{"startLine":1430}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa3ddf349d23aa63ab860ae215e848d4dc6229a191fe34239193f59644a6eb56"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): internal/hook/inspect.go:146-158 | internal/hook/inspect.go:169-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 \u0060internal/hook/inspect.go:146\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":"internal/hook/inspect.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"e07f3017c36aedaa9c9ab81a0ad89de625ee9affb3dd95e237308eda2ebc2db2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): desktop/app.go:1454-1465 | desktop/app.go:2181-2192 | desktop/app.go:2297-2308 \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 \u0060desktop/app.go:1454\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":"desktop/app.go"},"region":{"startLine":1454}}}],"partialFingerprints":{"codehealthFindingId/v1":"37f41642de89be8a7d9efa076857acb4d6c9f774163935c4e2e842fcbece7181"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): desktop/dotenv.go:54-65 | desktop/dotenv.go:111-122 | internal/config/credentials.go:775-786 \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 \u0060desktop/dotenv.go:54\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":"desktop/dotenv.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"736f3c4311a61abcdd9b9b248d5d18bac5a60d396b0fa38d8623ac255d415ce3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): desktop/app.go:7773-7786 | desktop/app.go:9159-9170 \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 \u0060desktop/app.go:7773\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":"desktop/app.go"},"region":{"startLine":7773}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8cb43f9725100e5d63585292346bb5f3cc0258f0c8a3f7957bf584854e4eb4a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): desktop/cmd/windows-resource/main.go:217-228 | internal/memory/store_v2.go:519-530 \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 \u0060desktop/cmd/windows-resource/main.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":"desktop/cmd/windows-resource/main.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"aac6473c641be3a727d85d623f63ebdeb2dd58c86feb6cb74a9e607b935f2e27"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): desktop/tabs.go:3759-3770 | desktop/tabs.go:3847-3858 \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 \u0060desktop/tabs.go:3759\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":"desktop/tabs.go"},"region":{"startLine":3759}}}],"partialFingerprints":{"codehealthFindingId/v1":"eeff11a7403292d086634452f5ca9720c72b26851adb97254d11edefedac181e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): desktop/tabs.go:3887-3901 | desktop/tabs.go:3937-3948 \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 \u0060desktop/tabs.go:3887\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":"desktop/tabs.go"},"region":{"startLine":3887}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f757180f6a37bf3305b08c22f8aa8d6ecf000e872d0d66d1cf433875d431634"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): desktop/theme_plugin.go:275-286 | desktop/theme_assets.go:129-141 \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 \u0060desktop/theme_plugin.go:275\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":"desktop/theme_plugin.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e5ca6387603fa9d5c1c7caf9b3943ecff4b60ef269ffb7c495c9e8076ebc4b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/acp/server.go:269-280 | internal/extension/rpcwire/conn.go:475-486 \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 \u0060internal/acp/server.go:269\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":"internal/acp/server.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8db08c14c76e63e0cb0e2ae272e21463e0ed0e815a2e23947138abfd88b88d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/agent/save.go:280-291 | internal/agent/save.go:382-393 \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 \u0060internal/agent/save.go:280\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":"internal/agent/save.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"0abb6664031477f56ab58c8dee71d37744786e6197b16f4db2be4a12ff5ea42b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/agent/task.go:1183-1196 | internal/agent/task.go:1594-1605 \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 \u0060internal/agent/task.go:1183\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":"internal/agent/task.go"},"region":{"startLine":1183}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb42d185036b9abd1b4585af809c7dfd911fab38c80c9894b87e1ba1b668e2c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/boot/boot.go:1704-1715 | internal/boot/boot.go:1744-1755 \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 \u0060internal/boot/boot.go:1704\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":"internal/boot/boot.go"},"region":{"startLine":1704}}}],"partialFingerprints":{"codehealthFindingId/v1":"1371922b1ac5f6313cfa6c416b10e6f0f7bef0f950fb334b086c4ed6bde8cf14"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/bot/pairing.go:247-258 | internal/botruntime/runtime.go:364-375 \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":"internal/bot/pairing.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0aeb7ce502e8873acff26bdf1150e913ea98e3ac52871272ba2d8c9bff4d377"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/cli/cli.go:594-605 | internal/cli/cli.go:1109-1120 \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 \u0060internal/cli/cli.go:594\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":"internal/cli/cli.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa93a4165037c1a6aaa4a35363cb823293d52c18af062f0ea8c66cb493e33ad6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/cli/plugin.go:216-227 | internal/cli/plugin.go:332-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 \u0060internal/cli/plugin.go:216\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":"internal/cli/plugin.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c2a00535948c73cca4727eb0823251247dd6aef7860c9bf848bbeda6ff20b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/cli/select.go:382-393 | internal/cli/select.go:442-453 \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 \u0060internal/cli/select.go:382\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":"internal/cli/select.go"},"region":{"startLine":382}}}],"partialFingerprints":{"codehealthFindingId/v1":"01a7c81ccc8aad3c2b4b7aba7d0a122601018b2fc7da121c67346ca34e1a12eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/control/controller.go:1324-1335 | internal/control/controller.go:1348-1359 \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":"internal/control/controller.go"},"region":{"startLine":1324}}}],"partialFingerprints":{"codehealthFindingId/v1":"7985a6ec689372825e2934e31f1469f5f4fa519c0c39a9157eba2af757929fed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/control/controller.go:3207-3222 | internal/control/controller.go:3291-3302 \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":"internal/control/controller.go"},"region":{"startLine":3207}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f26d4fe1ec2320df56c286bd0dc5442d20a7f08892863c2f6dd89d2bd924258"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/evidence/evidence.go:766-777 | internal/evidence/evidence.go:786-797 \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 \u0060internal/evidence/evidence.go:766\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":"internal/evidence/evidence.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"4eca783bfac7c4ec05ad2458c0b0cc3c042c665aac62e0815bf97a885140ecca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): internal/evidence/evidence.go:852-864 | internal/evidence/evidence.go:876-887 \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 \u0060internal/evidence/evidence.go:852\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":"internal/evidence/evidence.go"},"region":{"startLine":852}}}],"partialFingerprints":{"codehealthFindingId/v1":"58b8e4a8375b9d0b0c9b8fd7391533923413140ed8c039260458928df354c533"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 11): desktop/sessions.go:86-96 | desktop/sessions.go:1019-1029 | desktop/sessions.go:1156-1166 | internal/acp/service.go:2707-2717 | internal/agent/branch.go:222-232 | internal/agent/migrate.go:916-926 | internal/agent/session_events.go:867-877 | internal/agent/session_lease.go:288-298 | internal/agent/subagent_store.go:909-919 | internal/jobs/artifacts.go:148-158 | internal/plugin/stats.go:257-267 \u2014 there are 11 copies across 9 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 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060desktop/sessions.go:86\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":"desktop/sessions.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2fd1ceb178d73d60948fbceab992d76a1cb86eeb941970a00fac1e1a6b25304"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): internal/checkpoint/transaction.go:182-192 | internal/checkpoint/transaction.go:876-886 | internal/checkpoint/transaction.go:1621-1631 \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 \u0060internal/checkpoint/transaction.go:182\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":"internal/checkpoint/transaction.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a0ab5dd51c747f59332b3d881a911b67d83548a6dc1e6c743dbfb229a7bae95"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): internal/config/load.go:891-901 | internal/config/load.go:936-946 | internal/config/load.go:978-988 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/config/load.go"},"region":{"startLine":891}}}],"partialFingerprints":{"codehealthFindingId/v1":"284191c887fa6eb975a30614d1b4b46b0c52a30afbb27a6cf952881c766f9cbe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:2053-2063 | desktop/app.go:7191-7201 \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":"desktop/app.go"},"region":{"startLine":2053}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d55fad92c71953d8eb18c909bb239f7424196201f7453567b49a18ca34adf1b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:4020-4030 | desktop/app.go:4092-4102 \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 \u0060desktop/app.go:4020\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":"desktop/app.go"},"region":{"startLine":4020}}}],"partialFingerprints":{"codehealthFindingId/v1":"7183c92cfa6dd9e5e83f3cadfb7d3ca398705ed3f461250fc81ad1a4dc63a2e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:4045-4055 | desktop/app.go:4070-4080 \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 \u0060desktop/app.go:4045\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":"desktop/app.go"},"region":{"startLine":4045}}}],"partialFingerprints":{"codehealthFindingId/v1":"18037a31d0fc5b8e31289e307618ba7f70fcf0425f9d7a10d87fcbae48a2cb57"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:5620-5630 | desktop/app.go:5713-5723 \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 \u0060desktop/app.go:5620\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":"desktop/app.go"},"region":{"startLine":5620}}}],"partialFingerprints":{"codehealthFindingId/v1":"7273699763aee937407b5706063473c55ed904c66c7796ea90d032f647945514"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:9471-9481 | internal/cli/mcp_manager_actions.go:186-196 \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 \u0060desktop/app.go:9471\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":"desktop/app.go"},"region":{"startLine":9471}}}],"partialFingerprints":{"codehealthFindingId/v1":"9207bb55572dc2be99292d07fefe666a4350ed1fdf8c9f2b72d46ed3f02e1c90"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:10204-10214 | desktop/app.go:10344-10354 \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 \u0060desktop/app.go:10204\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":"desktop/app.go"},"region":{"startLine":10204}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e4be7bc8bec0f7f3267b9df5c9f3a9ea2757b87e520ff0a389e5d8e41dd5fa2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/app.go:10289-10299 | desktop/app.go:10429-10439 \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 \u0060desktop/app.go:10289\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":"desktop/app.go"},"region":{"startLine":10289}}}],"partialFingerprints":{"codehealthFindingId/v1":"f28308184d4af04903e000713fa6437b5074779dae3555399d270544e5226f8f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/sessions.go:255-265 | desktop/sessions.go:480-490 \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 \u0060desktop/sessions.go:255\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":"desktop/sessions.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"11e0235a479b48708c1c529d27d755a7725cc756a0ba375ef9cd77f852c23db4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/settings_app.go:865-875 | desktop/workspace.go:83-93 \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 \u0060desktop/settings_app.go:865\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":"desktop/settings_app.go"},"region":{"startLine":865}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f3aeebf5dd85aa6f6557ac58b4135cb26d2357d58ab705a7fa70a30a6de3164"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/tabs.go:2655-2665 | desktop/tabs.go:2711-2721 \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 \u0060desktop/tabs.go:2655\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":"desktop/tabs.go"},"region":{"startLine":2655}}}],"partialFingerprints":{"codehealthFindingId/v1":"74b9315d7f3e0e255fff601400a0c2d507310a5f9be5ba9be73efe71a9dc72f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/tabs.go:3842-3852 | desktop/tabs.go:3882-3892 \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 \u0060desktop/tabs.go:3842\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":"desktop/tabs.go"},"region":{"startLine":3842}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb6b73a3616ab0763b3f88ca95bbe197a4c360186e714eb81d0ff9526633db1f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/tabs.go:7190-7200 | desktop/tabs.go:7206-7216 \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 \u0060desktop/tabs.go:7190\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":"desktop/tabs.go"},"region":{"startLine":7190}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb9c892fd0fadabc858c2b76e63072f9274aa0bb798f06aec56637301215feff"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/updater.go:279-289 | internal/cli/upgrade.go:336-346 \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":"desktop/updater.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"f90f563b22bce212574861f2c38b48547818b410e5528f64f67bcdae387433b4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): desktop/remote_cli_download.go:15-25 | internal/cli/remote_connect.go:338-348 \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. 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":"desktop/remote_cli_download.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"0651b9996d18473e5975c31f1653d73cfa1008225c1db29c8ffb4b41441a585e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/acp/service.go:672-682 | internal/acp/service.go:971-981 \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":"internal/acp/service.go"},"region":{"startLine":672}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b28d53c6ce378a344aa95589d93fa2dc744cb9151db27716dd6a9ba4a1a81f1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/agent/branch.go:350-360 | internal/agent/save.go:1895-1905 \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":"internal/agent/branch.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"abbc868b18b5aab425deeb36c913a4b3dd308d0ce547fac571433e8d661873b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/agent/session.go:232-242 | internal/agent/session.go:260-270 \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 \u0060internal/agent/session.go:232\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":"internal/agent/session.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"f967898aec3f38abe7b88e9224e2cde2e1835aa2edfc115ccd0363d57beec543"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/agent/usecapability.go:577-587 | internal/agent/usecapability.go:595-605 \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":"internal/agent/usecapability.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f4f222b0bf03bbf2c27e18a2207a456a2169ab4d3b320aa7e816f4ae990f01a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/autoresearch/store.go:948-958 | internal/autoresearch/store.go:996-1006 \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 \u0060internal/autoresearch/store.go:948\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":"internal/autoresearch/store.go"},"region":{"startLine":948}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e30ce4be87ae06e35dcc4319454a963367a2517b72e39e69f9c62f9fc345b46"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/boot/boot.go:1419-1429 | internal/control/controller.go:5121-5131 \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 \u0060internal/boot/boot.go:1419\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":"internal/boot/boot.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"6426659e3f48cad7a35d7179f21153e6fc8c1f475700eac838b6bdd598b70162"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/bot/qq/gateway.go:155-165 | internal/bot/qq/gateway.go:429-439 \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 \u0060internal/bot/qq/gateway.go:155\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":"internal/bot/qq/gateway.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"90fb0ec441fb0a3950627644f389c06adae739bbbcf78faabec7c9264014b91f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/cli/select.go:143-154 | internal/cli/select.go:330-340 \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 \u0060internal/cli/select.go:143\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":"internal/cli/select.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"36ab3b15422385e04eed9ac494a86a645c4c3e2a1f311519f1901578ce4b93bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/control/refs.go:999-1009 | internal/control/refs.go:1078-1088 \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 \u0060internal/control/refs.go:999\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":"internal/control/refs.go"},"region":{"startLine":999}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c66c1ba0100c05a9a30e09b00142258997b9adb91be3f29a09a85cae73ebb96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): desktop/app.go:8994-9003 | desktop/app.go:9080-9089 | desktop/app.go:9182-9191 \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 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":"desktop/app.go"},"region":{"startLine":8994}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec697ea7ca076eb43b134118c02da0315141f24e45c2ff7df0cc6e2f73cbe7e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): desktop/app.go:10008-10017 | desktop/app.go:10218-10227 | desktop/app.go:10358-10367 \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 \u0060desktop/app.go:10008\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":"desktop/app.go"},"region":{"startLine":10008}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e08fa86221b1640a251179accc562959f1997eaccd05b164fc6e82dfcb28646"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/app.go:2224-2233 | desktop/app.go:2256-2265 \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 \u0060desktop/app.go:2224\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":"desktop/app.go"},"region":{"startLine":2224}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc006f529d92deac5e63b0f6070edc9ee20952d9d708c0406f2805af3e0fdbca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/app.go:3479-3488 | desktop/app.go:3536-3545 \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 \u0060desktop/app.go:3479\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":"desktop/app.go"},"region":{"startLine":3479}}}],"partialFingerprints":{"codehealthFindingId/v1":"db352c7bed949a71f96cd68998d2653adbe7e9f87d8e869ec7fae80c6bfef4d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/app.go:5307-5316 | desktop/app.go:5339-5348 \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 \u0060desktop/app.go:5307\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":"desktop/app.go"},"region":{"startLine":5307}}}],"partialFingerprints":{"codehealthFindingId/v1":"f33089af6d192c91b3a08834ad5a905234ba11f06f2d2a0da77e3799ee4f8a94"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/app.go:10257-10266 | desktop/app.go:10397-10406 \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 \u0060desktop/app.go:10257\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":"desktop/app.go"},"region":{"startLine":10257}}}],"partialFingerprints":{"codehealthFindingId/v1":"550a63d8b929b8e22c02228f6a32c3b41710176b9c6b97ee209a5d0356013482"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/crash_app.go:261-270 | desktop/telemetry_app.go:81-90 \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":"desktop/crash_app.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"50147142280a4d053f3cbbc1277eb12b4cd8f2664e1599ecdeec56d8310e9e0b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/settings_app.go:2190-2199 | internal/cli/subagent.go:497-506 \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 \u0060desktop/settings_app.go:2190\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":"desktop/settings_app.go"},"region":{"startLine":2190}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ab69ccf2ea13e4765150db7a67203ef3cf653b0b5544dce7bc06370f6b885fb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/settings_app.go:2730-2739 | desktop/settings_app.go:2762-2771 \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":"desktop/settings_app.go"},"region":{"startLine":2730}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8be4d55274fcd14bd568e42649c2ed03b69843217e1cd506c1532339fb1bd80"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/tabs.go:9192-9201 | desktop/tabs.go:9218-9227 \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":"desktop/tabs.go"},"region":{"startLine":9192}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b419507c431b0f6d7b31f452b45ed2020ea4db790d7a635b39fe15db9cdea96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): desktop/theme_pack.go:415-424 | desktop/theme_pack.go:457-466 \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 \u0060desktop/theme_pack.go:415\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":"desktop/theme_pack.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"96970ad174744ebea0b306dfa870c3a0c506f2c7ce8ebc05100937833db9533a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/acp/server.go:305-314 | internal/extension/rpcwire/conn.go:562-571 \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 \u0060internal/acp/server.go:305\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. 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":"internal/acp/server.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"edb2019a42953a5bf76ead92556815e338776855c78fdc1694b20de224d28c09"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/agent/migrate.go:160-169 | internal/agent/migrate.go:448-457 \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 \u0060internal/agent/migrate.go:160\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":"internal/agent/migrate.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"372f3b502e0bccb0e27297c637897937cb69fa09236f05240dae50ffc051cdff"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/agent/migrate.go:229-238 | internal/agent/migrate.go:443-452 \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 \u0060internal/agent/migrate.go:229\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":"internal/agent/migrate.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"64434fad49e03b419f520f9bfcfd376b786029446453ebccc4973c254476a16b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/botruntime/runtime.go:481-490 | internal/botruntime/runtime.go:518-527 \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 \u0060internal/botruntime/runtime.go:481\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":"internal/botruntime/runtime.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"e44ff567b2b6506b4a4ce7899daf1b875acd81a79ccd0424dbcd057131fbb337"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/cli/cli.go:2560-2569 | internal/cli/cli.go:2633-2642 \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":"internal/cli/cli.go"},"region":{"startLine":2560}}}],"partialFingerprints":{"codehealthFindingId/v1":"46d6dce55d62c6f56f2638b079718c49fb933f26bbdb0a70b72214862516b5ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/cli/cli.go:2580-2589 | internal/cli/cli.go:2653-2662 \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 \u0060internal/cli/cli.go:2580\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":"internal/cli/cli.go"},"region":{"startLine":2580}}}],"partialFingerprints":{"codehealthFindingId/v1":"02af9e26c11ff72fb367c2c88627c601cb47f22c2a8b745d02ecbed12fa6c01c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/cli/select.go:204-213 | internal/cli/select.go:400-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/cli/select.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"6af311b2ce4bdea6091a896c689d6c792764967e86e5d029713145d10106d53b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/cli/session_machine.go:166-175 | internal/cli/task_machine.go:92-101 \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 \u0060internal/cli/session_machine.go:166\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":"internal/cli/session_machine.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ef21f72f98ef3ddef2f1719a435453103afb9873894d34c3844321aeb35dd21"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/command/command.go:89-101 | internal/command/inspect.go:62-71 \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 \u0060internal/command/command.go:89\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":"internal/command/command.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2129c273655b5af3440a4aa3b2cc94ce17a1914864cb68c35354fadc5effded"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/doctor/session_redact.go:364-373 | internal/doctor/session_redact.go:448-457 \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 \u0060internal/doctor/session_redact.go:364\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":"internal/doctor/session_redact.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"2947a4249e75ac751ba03a772fcd54b63efdee24f3cf412abfc5082757fb744f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/hook/hook.go:330-339 | internal/hook/inspect.go:203-212 \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 \u0060internal/hook/inspect.go:203\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":"internal/hook/hook.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"e01350a0e44a687d8ce6dd8581bf0ec72814b1475a0219e20d9b834d62ad10c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/memory/store.go:563-572 | internal/memory/store.go:598-607 \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 \u0060internal/memory/store.go:563\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":"internal/memory/store.go"},"region":{"startLine":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"b39e608301ca5e67bf03983ebb14a6c308e0d775405c11d2d0d0601c536c45ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/memory/store.go:726-735 | internal/memory/store_v2.go:264-273 \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 \u0060internal/memory/store.go:726\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":"internal/memory/store.go"},"region":{"startLine":726}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ec12fc8d1fb8b8e93356e3c1516582c60c3dab279606298e2b19a5aba925853"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/plugin/security.go:142-151 | internal/plugin/security.go:189-198 \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 \u0060internal/plugin/security.go:142\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":"internal/plugin/security.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fb922bd897add40fc96d5ccb205c98238f979e1f78b34774954d2da6f3735f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): desktop/app.go:9999-10007 | desktop/app.go:10207-10217 | desktop/app.go:10347-10357 \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 \u0060desktop/app.go:9999\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":"desktop/app.go"},"region":{"startLine":9999}}}],"partialFingerprints":{"codehealthFindingId/v1":"b19580849f3a63a88534db2d6c4fc56de334da1327ce124f306bd85aebfb6a43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): desktop/app.go:10091-10099 | desktop/app.go:10263-10271 | desktop/app.go:10403-10411 \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 \u0060desktop/app.go:10091\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":"desktop/app.go"},"region":{"startLine":10091}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7198c8083a98bd57bf6ab401321b9df370f9271f8961631b23ea5858f8f3611"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/background_runtime.go:117-125 | desktop/background_runtime.go:128-136 \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":"desktop/background_runtime.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"600ea95e9008bd348b0f87cd3a121a712481b4d485f91b3fd100f5c2bd42e3dc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/heartbeat.go:272-281 | desktop/heartbeat.go:292-300 \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 \u0060desktop/heartbeat.go:272\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":"desktop/heartbeat.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e1931ff25fdaa258c7c65f7ea35989f7067445559f943809ca5e74f4a8a2bd0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/settings_app.go:2577-2585 | desktop/settings_app.go:2634-2642 \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 \u0060desktop/settings_app.go:2577\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":"desktop/settings_app.go"},"region":{"startLine":2577}}}],"partialFingerprints":{"codehealthFindingId/v1":"56ebf35d4eb95fce87b235e5440813073b48438ca9fc12affd7c1fcbf4a7267e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/settings_app.go:2647-2655 | desktop/settings_app.go:2690-2698 \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 \u0060desktop/settings_app.go:2647\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":"desktop/settings_app.go"},"region":{"startLine":2647}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fd014a36157b7a504efe3e112c0a31b4290d10311f9bea34ea6c8f50508f1e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/settings_app.go:3762-3770 | desktop/settings_app.go:3784-3792 \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 \u0060desktop/settings_app.go:3762\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":"desktop/settings_app.go"},"region":{"startLine":3762}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7db3e7c320c8d7ecb511fcbb3401735c785f1b0bfed8ee3e3e744ddb07c0596"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/subagents_app.go:116-124 | desktop/subagents_app.go:195-203 \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 \u0060desktop/subagents_app.go:116\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":"desktop/subagents_app.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7a99ae4d8ba4c3ab38a6ad8a74e80389612b850df256cd15d39a451e54023cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/tabs.go:5784-5792 | desktop/tabs.go:5815-5823 \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 \u0060desktop/tabs.go:5784\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":"desktop/tabs.go"},"region":{"startLine":5784}}}],"partialFingerprints":{"codehealthFindingId/v1":"e57ee0764ba280fc30aeb64d654648b4311774bf268a8d781b354915b739f842"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/updater_app.go:91-99 | desktop/updater_app.go:109-117 \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 \u0060desktop/updater_app.go:91\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":"desktop/updater_app.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0f7876074c3e445212e39630ab58bc7c3e5d3e926c008dbb978021fb304c005"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/updater_windows.go:165-173 | desktop/updater_windows.go:186-194 \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":"desktop/updater_windows.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"70e64b261e401b8074284d4025d06e844605ec493289194443a734b5d16654a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): desktop/workspace.go:112-120 | desktop/workspace.go:141-149 \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 \u0060desktop/workspace.go:112\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":"desktop/workspace.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"047b7ea5e69ae049a85717201702609cc3284663bbe154cc0dffd857eb663313"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/acp/service.go:1355-1367 | internal/acp/service.go:1861-1869 \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":"internal/acp/service.go"},"region":{"startLine":1355}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f5632a585541823245b0a7d102e78b975cb3a131e4d17ec72eb9a323dfc06e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/acp/service.go:2698-2706 | internal/agent/branch.go:213-221 \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":"internal/acp/service.go"},"region":{"startLine":2698}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dac934ea0523aa8735ce057aff6e8476f084acffdecd27fc7db1e7f81ea0e73"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/agent/session.go:113-121 | internal/agent/session.go:149-157 \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 \u0060internal/agent/session.go:113\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":"internal/agent/session.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ecf2f4173681e29db09a0b4e7e39105ccf872ea5e7cd64f2458d85b9ba56ebd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/autoresearch/readiness.go:22-30 | internal/autoresearch/store.go:541-549 \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 \u0060internal/autoresearch/readiness.go:22\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. 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":"internal/autoresearch/readiness.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"c252b4a29b884caaa31e4e3f31a82d0688b860b240a09aec85421857004f848e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/checkpoint/transaction.go:388-396 | internal/checkpoint/transaction.go:700-708 \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 \u0060internal/checkpoint/transaction.go:388\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":"internal/checkpoint/transaction.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"16cef5300bc3c061cda5a2b163dd863846058406bb654740a3baacfe41baa386"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/cli/cli.go:535-543 | internal/cli/cli.go:1050-1058 \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":"internal/cli/cli.go"},"region":{"startLine":535}}}],"partialFingerprints":{"codehealthFindingId/v1":"577513e20b7118cc2cd310d81b5279797c82edfa161ce8f1da48402286b85322"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/cli/cli.go:546-554 | internal/cli/cli.go:1057-1065 \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 \u0060internal/cli/cli.go:546\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":"internal/cli/cli.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"627e78d7ce4841cc3e8c532b169d970ccc38a21c6758339355c0d75752e87a52"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/cli/cli.go:2016-2024 | internal/cli/cli.go:2118-2126 \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 \u0060internal/cli/cli.go:2016\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":"internal/cli/cli.go"},"region":{"startLine":2016}}}],"partialFingerprints":{"codehealthFindingId/v1":"51988db875924cd273cf4fb4974aef8b375efe9d0596f93f8b875af4c52ead85"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/cli/runtime_rebuild.go:194-202 | internal/cli/work_mode.go:128-136 \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 \u0060internal/cli/runtime_rebuild.go:194\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":"internal/cli/runtime_rebuild.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3472f55002e677cd4e338caa7dd114ed8144e6d8ef2de1bf1e04ffd2a9edb31"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/cli/session_machine.go:103-111 | internal/cli/task_machine.go:55-63 \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 \u0060internal/cli/session_machine.go:103\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":"internal/cli/session_machine.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac29ba5482399a8e703714a223f022bba994675362e896e647ac7a3ef3959439"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/config/edit.go:914-922 | internal/config/edit.go:1218-1226 \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":"internal/config/edit.go"},"region":{"startLine":914}}}],"partialFingerprints":{"codehealthFindingId/v1":"25a2a810dc8e10062e8a485daf138851202b6f2c65e18a53633ee510b69fce1f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/config/edit.go:930-938 | internal/config/edit.go:1197-1205 \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 \u0060internal/config/edit.go:930\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":"internal/config/edit.go"},"region":{"startLine":930}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4e1903770ce3d83978f250a1c9142f13a853b83a89e165823b109a083e82842"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/config/render.go:769-777 | internal/config/render.go:1234-1242 \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 \u0060internal/config/render.go:769\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":"internal/config/render.go"},"region":{"startLine":769}}}],"partialFingerprints":{"codehealthFindingId/v1":"487df800d6b77b497d06c637b7554e6bb493cb93168b4a1180f336bc8a261ee2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/control/controller.go:1952-1960 | internal/control/turn_orchestrator.go:133-141 \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 \u0060internal/control/controller.go:1952\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":"internal/control/controller.go"},"region":{"startLine":1952}}}],"partialFingerprints":{"codehealthFindingId/v1":"5504c7f62063e066ece6f8c7755c2ef6fe5748ff6aa8e9e885fa78a5f2f38aa1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/control/controller.go:3504-3512 | internal/control/controller.go:3588-3596 \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":"internal/control/controller.go"},"region":{"startLine":3504}}}],"partialFingerprints":{"codehealthFindingId/v1":"765d2e780c400e6b3a94140bb251086d148e3bffbd605e54bfaa21a3aa42ca06"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/control/refs.go:1013-1021 | internal/control/refs.go:1092-1100 \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 \u0060internal/control/refs.go:1013\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":"internal/control/refs.go"},"region":{"startLine":1013}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1fef3c2bd8eadd99b63eb220966ecc58cecb1f1e44bafe4d8eb047d477d6e01"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/control/rewind.go:140-148 | internal/control/rewind.go:232-240 \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 \u0060internal/control/rewind.go:140\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":"internal/control/rewind.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d4104db721e305dd684b9b8c25079a167b299b6ac26140f65cbe16972c6bbdd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/evidence/evidence.go:1254-1263 | internal/evidence/review_report.go:164-172 \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 \u0060internal/evidence/evidence.go:1254\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. 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":"internal/evidence/evidence.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"370ce1d949f13f512f9f2a0240ed57da04b0648dfef4e4bef581482dc9324088"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/installsource/apply.go:109-117 | internal/installsource/apply.go:148-156 \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 \u0060internal/installsource/apply.go:109\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":"internal/installsource/apply.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"78627bb7e4612d04c6ad8a370531638b47d720d53422f378de6ca982627ce4c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/app.go:2080-2087 | desktop/bot_bridge_app.go:87-94 \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":"desktop/app.go"},"region":{"startLine":2080}}}],"partialFingerprints":{"codehealthFindingId/v1":"d078212f2ec63c84460880dc93f6abe0bc0056938c1dbe76e8a651f6942a13dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/app.go:2890-2897 | desktop/app.go:2902-2909 \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 \u0060desktop/app.go:2902\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":"desktop/app.go"},"region":{"startLine":2890}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cbe51bcd066a8bcd8aeced54700ee03bb27d8f944f427f7c29e7fb8b2518c24"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/app.go:3494-3501 | desktop/app.go:3553-3560 \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 \u0060desktop/app.go:3494\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":"desktop/app.go"},"region":{"startLine":3494}}}],"partialFingerprints":{"codehealthFindingId/v1":"f98d4f853d05a04821ccaa3366c11f0598587c14e9c573a31c19ac02be95c4b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/app.go:9261-9268 | desktop/app.go:9270-9277 \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 \u0060desktop/app.go:9261\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":"desktop/app.go"},"region":{"startLine":9261}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d5b1f9babf02fe16a1624c725be1665117daab864c434b7ab14d6c0b086788f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/sessions.go:775-782 | internal/agent/recovery_gc.go:609-616 \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 \u0060desktop/sessions.go:775\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":"desktop/sessions.go"},"region":{"startLine":775}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e391b72736bc7454c7692a33c7361f5148ce1b5d70d5576aee5d1eecf8c0d49"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): desktop/theme_pack.go:432-440 | desktop/theme_pack.go:472-479 \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":"desktop/theme_pack.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"6af653406a74fb95357dff3903e25bd38281904fd629736f89e9122d95859fe6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/acp/service.go:2872-2879 | internal/control/controller.go:3357-3364 \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 \u0060internal/acp/service.go:2872\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":"internal/acp/service.go"},"region":{"startLine":2872}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce8ee8e8226229461a0a9a6652490175e1f17d470143343226f2d5375516e2cc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/agent/migrate.go:127-137 | internal/agent/migrate.go:389-396 \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 \u0060internal/agent/migrate.go:127\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":"internal/agent/migrate.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c866ca8fc7c6dd10d5e056eea2a00d676aaf0a2fbd02761e17fb4be453b6a25"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/agent/migrate.go:304-311 | internal/agent/migrate.go:762-770 \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 \u0060internal/agent/migrate.go:304\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":"internal/agent/migrate.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"fef31143629759a29c7aa19c67d95ec558a0086f84ef9962b8280b974745cfa6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/boot/boot.go:1204-1211 | internal/boot/boot.go:1275-1282 \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":"internal/boot/boot.go"},"region":{"startLine":1204}}}],"partialFingerprints":{"codehealthFindingId/v1":"f567f48e5739bd16a833280e6e9f74e8879492284604798107c57820dcf5c032"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/boot/boot.go:1645-1652 | internal/boot/boot.go:1654-1661 \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 \u0060internal/boot/boot.go:1645\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":"internal/boot/boot.go"},"region":{"startLine":1645}}}],"partialFingerprints":{"codehealthFindingId/v1":"919df93451acbd886f25afe1295b245735fa29abe7d3484ddd5822c06699133c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/bot/gateway.go:1407-1415 | internal/bot/gateway.go:1432-1439 \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 \u0060internal/bot/gateway.go:1407\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":"internal/bot/gateway.go"},"region":{"startLine":1407}}}],"partialFingerprints":{"codehealthFindingId/v1":"349d5c7bb4fb5d043771c7500979095edb4237be0ff95af1989c5f4cc895bd1c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/checkpoint/transaction.go:426-433 | internal/checkpoint/transaction.go:464-473 \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 \u0060internal/checkpoint/transaction.go:426\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":"internal/checkpoint/transaction.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd86fc40ceb80f151480a9735d373ec3ec539e68bd8bbc6a026b764e75385a80"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/checkpoint/transaction.go:763-770 | internal/checkpoint/transaction.go:824-831 \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 \u0060internal/checkpoint/transaction.go:763\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":"internal/checkpoint/transaction.go"},"region":{"startLine":763}}}],"partialFingerprints":{"codehealthFindingId/v1":"a13f5a925eb2c6a0a366d9283b4d3d75c502399266064e22d2d41708068fc7b0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/checkpoint/transaction.go:783-790 | internal/checkpoint/transaction.go:792-799 \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 \u0060internal/checkpoint/transaction.go:783\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":"internal/checkpoint/transaction.go"},"region":{"startLine":783}}}],"partialFingerprints":{"codehealthFindingId/v1":"07ef71d844f28a611dada5ef8b4b919ac93aaae6f8d1ef1d762da64a0832e0dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/cli/cli.go:2590-2597 | internal/cli/cli.go:2663-2670 \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 \u0060internal/cli/cli.go:2590\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":"internal/cli/cli.go"},"region":{"startLine":2590}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e938787ca320c7d12f1db86a260bd6cdf8dcfc4b9d2a2709415763eb0a8bcb7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/cli/remote_connect.go:383-390 | internal/cli/remote_connect.go:607-614 \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":"internal/cli/remote_connect.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ae622608316d56b5927bc4bd1f4902b32a16ee806170ef07830050545661e0c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/config/render.go:308-315 | internal/config/render.go:1005-1012 \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 \u0060internal/config/render.go:308\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":"internal/config/render.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6614b4bc0cedf41b61c8e6c6c3f465a66fa16b36d4b86b837e7cb37e63f8188"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/config/render.go:354-361 | internal/config/render.go:1051-1058 \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 \u0060internal/config/render.go:354\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":"internal/config/render.go"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"617d7c717025d3da76f6b0f04725c693b1c9ee27542c098f25f286b2d971aac5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/config/render.go:748-755 | internal/config/render.go:1214-1221 \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 \u0060internal/config/render.go:748\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":"internal/config/render.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"94eae8c67d75471f94e42ad69eae0c6363c1fc28f78cc69a83712a5927ef8f15"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/control/controller.go:3483-3490 | internal/control/controller.go:3568-3575 \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":"internal/control/controller.go"},"region":{"startLine":3483}}}],"partialFingerprints":{"codehealthFindingId/v1":"95f1840c0e5cde4d91da2a1f9dfbb7ede856bbd265e2b740b83521c144a11633"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/control/turn_orchestrator.go:399-406 | internal/control/turn_orchestrator.go:423-430 \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 \u0060internal/control/turn_orchestrator.go:399\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":"internal/control/turn_orchestrator.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dd8e4df28fb6357c8f341b06a9426577f641fd172e231801f72c91c92179e4e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/evidence/evidence.go:1037-1044 | internal/evidence/evidence.go:1332-1339 \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 \u0060internal/evidence/evidence.go:1037\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":"internal/evidence/evidence.go"},"region":{"startLine":1037}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6bbb656479393b3702879d54ff1192e5bf0d9278632c30883b4b76ac125517e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/memory/auto_recall.go:164-171 | internal/memory/recall.go:140-147 \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":"internal/memory/auto_recall.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"6603e4c1ba7837c1a033751f9679d1904aa49365bb3b07997440891910297294"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/app.go:2596-2602 | desktop/app.go:2862-2868 \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":"desktop/app.go"},"region":{"startLine":2596}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f0eea064e8fcdbf9a92f54522cac2b2b950619d494cfc2530ba3e3b0d01afba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/app.go:4222-4228 | desktop/app.go:4246-4252 \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":"desktop/app.go"},"region":{"startLine":4222}}}],"partialFingerprints":{"codehealthFindingId/v1":"7122956283aedb13665d19deb4af70e68b944a226b7a4db5f8f6b1788d568465"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/app.go:5324-5330 | desktop/tabs.go:3188-3197 \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 \u0060desktop/app.go:5324\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":"desktop/app.go"},"region":{"startLine":5324}}}],"partialFingerprints":{"codehealthFindingId/v1":"11933fb6952c0324645db8c11abbc226b55fa0d69e2f6dad4ef2479c643f3d63"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/remote_app.go:849-855 | internal/cli/remote_connect.go:87-93 \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 \u0060desktop/remote_app.go:849\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":"desktop/remote_app.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"676bd34b4e8b68d1336575770781dc71bd8963baa914c1f39098d2156f806b4c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/sessions.go:226-232 | desktop/sessions.go:281-287 \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 \u0060desktop/sessions.go:226\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":"desktop/sessions.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"31701c6ed5209fab89f6501d4aef724eaea2570038a8a93335e95edd1b2fd6f1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): desktop/theme_app.go:93-99 | desktop/theme_app.go:222-228 \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 \u0060desktop/theme_app.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"desktop/theme_app.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"64937f8169ecac77b0aa79e1a171c9f0ec6f565594c89cf6115eed8512f6b161"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/acp/service.go:1616-1622 | internal/acp/service.go:1681-1687 \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 \u0060internal/acp/service.go:1616\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":"internal/acp/service.go"},"region":{"startLine":1616}}}],"partialFingerprints":{"codehealthFindingId/v1":"e487297f28f8679fb70410ddf6c5d260110ae3c4a896a57116ac8980ba588515"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/acp/service.go:1800-1806 | internal/cli/cli.go:1396-1402 \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 \u0060internal/acp/service.go:1800\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":"internal/acp/service.go"},"region":{"startLine":1800}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd5da2ca5784e8a7c96d85a0e6e13dce401ddba1d2499f0a0546ef9b79e4cd1a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/agent/cache_shape.go:58-64 | internal/extension/snapshot.go:106-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 \u0060internal/agent/cache_shape.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. The matched lines also transfer control out of the body holding them, 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":"internal/agent/cache_shape.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"a96074e855d2d3490542bbe36b3cc9a1c6d7ce96457099fc0077ade28d4d4267"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/agent/session_lock_unix.go:22-28 | internal/agent/session_lock_unix.go:48-54 \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 \u0060internal/agent/session_lock_unix.go:22\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":"internal/agent/session_lock_unix.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4d4df1f97a3666ecc70ab8720c50a26f7675cd2cec9d0ad854a4f427af78bb3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/bot/project_index.go:70-76 | internal/bot/project_index.go:185-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 \u0060internal/bot/project_index.go:70\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":"internal/bot/project_index.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"83375f44ecd434e4b49ca67af18a568179c44c6b469191e9c72847a841e5a70b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/bot/project_index.go:83-89 | internal/bot/project_index.go:196-202 \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 \u0060internal/bot/project_index.go:83\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":"internal/bot/project_index.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"d66850e6279b710896e8a403d8fdeb3e98b20411743a5bb0af26b5758dfa3453"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/checkpoint/transaction.go:372-378 | internal/checkpoint/transaction.go:667-673 \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":"internal/checkpoint/transaction.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfd0217825eb79620f4f8dd913424674518b4bbbf29e06a93f23f8c3eb74f29f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/cli/chat_tui.go:2314-2320 | internal/cli/chat_tui.go:2621-2627 \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 \u0060internal/cli/chat_tui.go:2314\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":"internal/cli/chat_tui.go"},"region":{"startLine":2314}}}],"partialFingerprints":{"codehealthFindingId/v1":"eebc2fa56f68758b29bcd03813a500f3430da71901d539996f1117933dfe4b99"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/cli/cli.go:634-640 | internal/cli/cli.go:1142-1148 \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 \u0060internal/cli/cli.go:634\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":"internal/cli/cli.go"},"region":{"startLine":634}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8d91a3ba10fc15c3607aed29bd59f69c6933895da2fa2a6c9bfd46a69f1ba45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/control/slash.go:352-358 | internal/control/slash.go:359-365 \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 \u0060internal/control/slash.go:352\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":"internal/control/slash.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b164ae0736d2279dcc716e553cd3b124d791904bf86861f66a65436ea0b3b26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/instruction/resolver.go:220-226 | internal/instruction/resolver.go:229-235 \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 \u0060internal/instruction/resolver.go:220\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":"internal/instruction/resolver.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee886f5d6812af2460b3f2d20303c7faaa6a59715719b42078a74fd157e169f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): internal/control/rewind.go:133-138 | internal/control/rewind.go:178-183 | internal/control/rewind.go:225-230 \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 \u0060internal/control/rewind.go:133\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":"internal/control/rewind.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6b2f72f502d07d49f2ba751a673bf632b8f9d315f4f843104f221faf803f480"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): desktop/crash_app.go:44-49 | internal/crashreport/cli.go:359-364 \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":"desktop/crash_app.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"7740597e6f420861abdd8c4c7504df32c3bc5503689f9bcb80601b1ba7f0487b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): desktop/icon_repair_windows.go:165-170 | desktop/icon_repair_windows.go:186-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 \u0060desktop/icon_repair_windows.go:165\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":"desktop/icon_repair_windows.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"44adaeeae715e11f456edf33bccb413ada82b19211aaab193b9f5a8d626e1955"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/bot/gateway.go:2601-2606 | internal/bot/gateway.go:2612-2617 \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":"internal/bot/gateway.go"},"region":{"startLine":2601}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c1b72744e39ef66e97b8b0f91ff0add2323be263e436c31ef55a8f667f896b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/checkpoint/transaction.go:205-211 | internal/checkpoint/transaction.go:896-901 \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 \u0060internal/checkpoint/transaction.go:205\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":"internal/checkpoint/transaction.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8d1309d63b2fb4d454709efc9767ab9672ebad3ea1baade03ca567261ad7bf3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/cli/chat_tui.go:2699-2704 | internal/cli/chat_tui.go:2787-2793 \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 \u0060internal/cli/chat_tui.go:2699\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":"internal/cli/chat_tui.go"},"region":{"startLine":2699}}}],"partialFingerprints":{"codehealthFindingId/v1":"766382c8dc9d2b510f655fffd6ef2c39127f8873ed34502e40978d4a37caaafb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/cli/cli.go:1998-2003 | internal/cli/cli.go:2100-2105 \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 \u0060internal/cli/cli.go:1998\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":"internal/cli/cli.go"},"region":{"startLine":1998}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd0acfae81d9feb83771e859eceafe037da83c14494f35d90234ed4ea0cbf012"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/config/render.go:298-303 | internal/config/render.go:995-1000 \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 \u0060internal/config/render.go:298\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":"internal/config/render.go"},"region":{"startLine":298}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ac907242dde4ea052d94980a9b0bfa81b58d670513ea43e7bedd9859b6c5e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/config/render.go:1728-1733 | internal/config/render.go:1761-1766 \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":"internal/config/render.go"},"region":{"startLine":1728}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebd790bb35101c1c745d0a87bb681b81ec55fde4770da93ce3b6a6823b9e3a93"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/control/refs.go:1029-1034 | internal/control/refs.go:1108-1113 \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 \u0060internal/control/refs.go:1029\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":"internal/control/refs.go"},"region":{"startLine":1029}}}],"partialFingerprints":{"codehealthFindingId/v1":"11ef1e04af75043b625a89eaf95d5badfaed4ee304e50f44b4534ba40b7e1546"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/control/rewind.go:114-119 | internal/control/rewind.go:290-295 \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 \u0060internal/control/rewind.go:114\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":"internal/control/rewind.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b7cbf5a8de089265d1e4cc39fdcfe2e6223248d0e8b78b4cce9e787eca2e10f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): internal/eventwire/wire.go:70-75 | internal/eventwire/wire.go:331-336 \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 \u0060internal/eventwire/wire.go:70\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":"internal/eventwire/wire.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"abe6ebab267798fbdb47a88c83deba520561c1c57a218c4fdea29303a0e776ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): desktop/theme_contrast.go:107-111 | internal/cli/theme.go:339-343 \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 \u0060desktop/theme_contrast.go:107\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":"desktop/theme_contrast.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9edc37c74d355b505f6c3f796eff5a61fa1f43415421c7bd9c484d2958f9e61"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): desktop/updater_app.go:136-140 | desktop/updater_app.go:226-230 \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 \u0060desktop/updater_app.go:136\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":"desktop/updater_app.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a7e608d93af0cca8fb7938ce959dc78a0d6871a2a2cf9bac09bc6762e2447c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/bot/feishu/inbound.go:102-106 | internal/bot/feishu/inbound.go:108-112 \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. 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":"internal/bot/feishu/inbound.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9ae30dfcf0fcade594ad6970bc8b1318498de8b31860368454bed5598c1a43f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/checkpoint/transaction.go:256-260 | internal/checkpoint/transaction.go:1650-1654 \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. 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":"internal/checkpoint/transaction.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1ce25463e64baf4512becfbc9e54109a9780a1876d372a572e1209627a7b12d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/command/command.go:139-143 | internal/command/inspect.go:115-119 \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":"internal/command/command.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"01ef8f71f88eb8f8bdb47bc043413dda6d446e251012c65436295c3331103062"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/config/migrate.go:166-170 | internal/config/migrate.go:534-538 \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 \u0060internal/config/migrate.go:166\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":"internal/config/migrate.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4c30d264a6ea1c7ad6b6e4ca93f160f06a79766f0329a4fd33675e656c321d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/control/controller.go:4571-4575 | internal/control/controller.go:4612-4616 \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":"internal/control/controller.go"},"region":{"startLine":4571}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b02aef40af69e8f3503d03360de7c1073490e0bef56198546d8f01bd9f295d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/jobs/jobs.go:1666-1670 | internal/jobs/jobs.go:1844-1848 \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 \u0060internal/jobs/jobs.go:1666\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":"internal/jobs/jobs.go"},"region":{"startLine":1666}}}],"partialFingerprints":{"codehealthFindingId/v1":"511873337168670c7c26adc670b87d181c412bc69d520ac29bd71a39211d862a"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/boot/boot.go: internal/boot/boot.go changed 256 times in last 90 days, max complexity 310. 107 of those changes were fix/bug commits, and the other 149 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":"internal/boot/boot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d30df6cfe8bf44e45f7dbe74ff0a5c96776a37c36ba8862cdb4e5dc2dfc3d2e6"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/cli/chat_tui.go: internal/cli/chat_tui.go changed 226 times in last 90 days, max complexity 252. 99 of those changes were fix/bug commits, and the other 127 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":"internal/cli/chat_tui.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f1af5185f391b4131e1cf49f2e485ee7dddb6831ec2850b39ee091280bb0ddb"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: desktop/app.go: desktop/app.go changed 416 times in last 90 days, max complexity 61. 248 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":"desktop/app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"61041cdef2276a51ba11f6286457c731b1926f0f4a765524d9c868a6b1da4897"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/config/render.go: internal/config/render.go changed 145 times in last 90 days, max complexity 152. 39 of those changes were fix/bug commits, and the other 106 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":"internal/config/render.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7216ddec26cb0df2486bafeb5fbdbdbc5e191bab5194217342f9677425054350"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: desktop/tabs.go: desktop/tabs.go changed 210 times in last 90 days, max complexity 74. 145 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":"desktop/tabs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6ebf6b789920a2c2ea03950187dbfd08b76edc6a49eff2d28da37cf8f616005"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/control/controller.go: internal/control/controller.go changed 329 times in last 90 days, max complexity 41. 164 of those changes were fix/bug commits, and the other 165 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":"internal/control/controller.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f1e0988a51f68b029cf4bb96634b93a4f9fb893524ab2fcdfe359ba16eca150"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/agent/agent.go: internal/agent/agent.go changed 216 times in last 90 days, max complexity 54. 123 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":"internal/agent/agent.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9586da5d79af8041ac9c6b813e1f24365ff5be13014c6edf1a48eeafeeab5800"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/cli/cli.go: internal/cli/cli.go changed 156 times in last 90 days, max complexity 61. 66 of those changes were fix/bug commits, and the other 90 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":"internal/cli/cli.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7f9fdd2b131f699b67257ce8c3131aff8548fca400ff7fe16591e3db9a4364a"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: desktop/settings_app.go: desktop/settings_app.go changed 162 times in last 90 days, max complexity 52. 74 of those changes were fix/bug commits, and the other 88 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":"desktop/settings_app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"eac9274d4c72df1c6bbae685cf006b0bbbad69a400266b3b7ff6169ee9f31de3"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/provider/openai/openai.go: internal/provider/openai/openai.go changed 80 times in last 90 days, max complexity 59. 53 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":"internal/provider/openai/openai.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9106b71565b28536e65c7a4865f9176c21b8989397c21079754df9172ca5c4ec"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 57 significant file(s) lose their only recent owner: internal/pluginpkg/pluginpkg.go, desktop/bot_connection_app.go, internal/agent/session_events.go, internal/installsource/plugin_package.go, internal/installsource/install_source.go, internal/bot/project_index.go, internal/botruntime/runtime.go, internal/agent/recovery_gc.go (\u002B49 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"987e54cf7c7d2fc4f6e2950e0d92fddc480587c98e31e7340bdad7ee5ddfe9c3"}},{"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: internal/cli/latex.go, benchmarks/context-maintenance-e2e/main.go, workers/crash-report/src/auth.ts, workers/accounts/src/db/deviceGrants.ts, internal/command/slashtool.go, internal/sysproxy/system_windows.go, workers/accounts/src/routes/device.ts, workers/accounts/src/auth/crypto.ts (\u002B3 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"9b7c31e9f22133db3376c405414f729bff5ef01b5992cf3492b39da837d74447"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 2 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 (71 single-owned of 574 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 #3 (2 file(s)), anonymized user #4 (1 file(s)) \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":"445f2150ba697f33af566e35d843f52067e1329a9cb53fa098da6a709cb61c98"},"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":"b51940eb1fbc7d2390f68eca44cb5ff6135f1153cb9f4e943cd70f6c3c072005"},"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":"7ceee73d76663034321cbd3b5bbecae8b673163039b70b12462f979a331e73d3"},"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":"8eb50784ab958284eb3ecd7050384e4061ddeae0c76cf46d9d242ff3f816fc6b"},"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":"e7a9139ada736d07ff392922c41056ab290cbfa563beec669fc516345f13b2e4"},"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":"4e5ba20d569d258ae6d0a24953bb1bf2096a834bc4a53403da7c12ca10d2411b"},"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":"77765882d55462152a369fef948de5215108ca7f45d82e78ff505271ac66abac"},"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":"229f33f5083a1fefa5ebd7f3b2a50f455445c022072eadf8ca675541407f621d"},"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":"2f9837116a08b8e6d1c399be63869d7e00828011b478e4dec43ad56ec6d8fca0"},"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":"ec18c7e38200a3ea39c3a5970f9d5b0810fd43fe6d132e294dfa65a87ec165c2"},"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":"63f6fe19604e9bbc201805ab413127670d457ca05c4ff3d9f121266d5a97d87d"},"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":"a0eefb026e7ade6a046f8e511b1ddfadd350bd67e499c9adb0d06831c2ab1a00"},"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":"3246b5222a032aab15d3aed73ed2340cb2d1abd2d19403ebd80dcf07e5221781"},"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":"7b27559f02931cfaa812d5363e5e3bb226c8361f092eed709ce00c8326fd6a2b"},"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":"154e79376669773c5d0b9fdf78d6c851f5f1957a6b54b003e1633160453b1407"},"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":"50854385222ed7f5d1948613cf1ac36ac8082a917ec3d410cf0276c5ba2053ff"},"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":"8035557874aea6d453f1ac510e51d138a9e685ca80c8ac1b5f00213db3f50a23"},"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":"18ffbbe72349beeca02b813e7a731cf97c1989f541de37e2ac5589abbb02bc76"},"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":"2cf4d06b19f728014310e8a5f11ef1b0f07eae92e76ce6f564993918839bf775"},"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":"1e2210c393bb92b7bb4a14d39bcbd332b86343148ea5ad556b91323f349478c5"},"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":"1e7226dbc7e755efa79efd9d5f3e0f22dec581aed577cb8c9cc286bce6a8cc9e"},"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":"75165003a1b18609e33a608e7c67d28254a74fe6175027bcb8362e593b091dcb"},"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":"af1753567989eec4ce635cda49eab44503d2c62f97c0372f025bbb1a257b475c"},"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":"5b8626211601d6a7ba6f641f410f4535c648612ca4595244d22117ca4fe9bc16"},"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":"3753c30b148e436393e0b8421c4d6a8df30c0bebbabecade871253bf1b7daa41"},"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":"d587f5b3d5b7a5da58a4dd5d4715d21c7f2db71423f87f1e9f0c1b025fc10401"},"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":"30fbb383e06a6eec56dbd03bd8782f7d57f7ead0dea7df29783732b935736cc8"},"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":"827a92e57e52ec71023b5c4e578fc4eabe6d342783df50a33d0075da332089fe"},"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":"9e9e714247379d345adf05cbd9a1ad53aad5678ea96a270c48e52c1fb5b25785"},"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":"9135e0cb9622c2e1838789bb54f1a3ef80580a981311b10310b35fc2c40544db"},"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":"c50de480766a7b165a1a642a67af95d5649f6621ffe29fc52e4448f771e31ddb"},"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":"bddbca9c804db274cab60d4e7683499ab56a35eafecf2d57c041bec73838e45c"},"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":"8245ecffab7fc3a27c0a2ba18983e425d52a371f08b0a870dc4705a6f646e964"},"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":"4d62ca29dcb9c846267936068dbc3043531ebf7b901d69562fd500fda4b4c5ee"},"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":"7d3a563bd5353ae5cdb1ed04550c41663adcbe2d50b0b3bc7365222059fae35a"},"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":"4949b589679256a846fcb6b8f93cef9fa2a9a885bb6d1c0edd588dbaa9bf8cd4"},"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":"2c2d0792db808982dbcc77a7622e68e346207d92efd029a85a499c43830c99a8"},"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":"ad0da8d8580f2104b2f2872a73b31bd992fc956dde974c88850abd0682ecf6b2"},"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":"398c331e326e2e95e0929838cc9c39977aaaffef8660b74abd884266af241b38"},"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":"6c22e05711aadf31e14ecd34c793f3e8ca25511194a6231122a85eb1506a45e2"},"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":"ee5c031d31755809413b2d15fd45a23d5fc9ae068d099f5233b947a7ea59a46d"},"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":"eb82124903c0ed51bbaa30a1a6adcb7f1a0cc0a88f93e4dbb7ac98d2bd021c7e"},"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":"fdce40aaecbef7da3cad053a43d6eb9854616b47b72ed27a69a11877271b1515"},"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":"868b900b61b100dcf75fad8b94f4245685b81dab9f1541e7f675bbe99af63e58"},"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":"98d0d7888918c585f48dcfdaee8dafc75f82b4e099a766c9adc6f3b5139d27c6"},"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":"ccbfec99236b6057a53769c6f0747a7ca56f443b7272f02ac8371f77c7c1acfd"},"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":"d3aab4f820b657ecec06341468dee218ff52e2f80bd4cec8bd43479900b4d5d1"},"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":"ad8a60014195d4dc873189a1f0a5977a84f5dc085690440da6c409a90b4580f9"},"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":"123fe8bf8387ed33486b10c77e1834348665379880ea6fc455a0abf9710c4750"},"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":"D35","level":"warning","message":{"text":"Change coupling: messages_zh.go \u2194 messages_zh_tw.go: \u0060internal/i18n/messages_zh.go\u0060 and \u0060internal/i18n/messages_zh_tw.go\u0060 change together 97% of the time (31 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/i18n/messages_zh.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f81a5c46a51e5de3bb378cf4855af003aca51694be5a14be2a24b2e8916b8ece"}},{"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":"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":"d657599f6f99da1927d3377533dfc0888b34c4d84aa7d5579841fd72d0e39bce"}},{"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":"6dfd57c149584e370b92cb4cc5bd0348c10adb5555ef29583d5ee6201556efd6"}},{"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":"e9c78251e0bcc6bcbbcc7fc33a88cfb59158d6737e643934803112065f4ec4cb"}}],"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-1059","guid":"a2381a08-60f6-9554-a8b8-f3018cfaaca5","name":"Insufficient Technical Documentation","shortDescription":{"text":"Insufficient Technical Documentation"},"helpUri":"https://cwe.mitre.org/data/definitions/1059.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-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-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":56,"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."]}]}