{"$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":"D6","name":"Cohesion (LCOM4)","shortDescription":{"text":"Cohesion (LCOM4)"},"helpUri":"https://codehealth.canine.dev/dimensions/D6"},{"id":"D8","name":"Code Coverage","shortDescription":{"text":"Code Coverage"},"helpUri":"https://codehealth.canine.dev/dimensions/D8"},{"id":"D9","name":"Test Distribution","shortDescription":{"text":"Test Distribution"},"helpUri":"https://codehealth.canine.dev/dimensions/D9"},{"id":"D10","name":"Test Quality","shortDescription":{"text":"Test Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D10"},{"id":"D11","name":"Test Reliability","shortDescription":{"text":"Test Reliability"},"helpUri":"https://codehealth.canine.dev/dimensions/D11"},{"id":"D12","name":"Dependency Hygiene","shortDescription":{"text":"Dependency Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/D12"},{"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":"D14","name":"License Compliance","shortDescription":{"text":"License Compliance"},"helpUri":"https://codehealth.canine.dev/dimensions/D14"},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D17","name":"Explicit Debt","shortDescription":{"text":"Explicit Debt"},"helpUri":"https://codehealth.canine.dev/dimensions/D17"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"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":"AC2","name":"Forms \u0026 labels","shortDescription":{"text":"Forms \u0026 labels"},"helpUri":"https://codehealth.canine.dev/dimensions/AC2"},{"id":"AC3","name":"Page structure","shortDescription":{"text":"Page structure"},"helpUri":"https://codehealth.canine.dev/dimensions/AC3"},{"id":"AC5","name":"ARIA correctness","shortDescription":{"text":"ARIA correctness"},"helpUri":"https://codehealth.canine.dev/dimensions/AC5"},{"id":"AC6","name":"Visual \u0026 motion safety","shortDescription":{"text":"Visual \u0026 motion safety"},"helpUri":"https://codehealth.canine.dev/dimensions/AC6"},{"id":"AC7","name":"A11y enforcement","shortDescription":{"text":"A11y enforcement"},"helpUri":"https://codehealth.canine.dev/dimensions/AC7"},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AX9","name":"CQS / query purity","shortDescription":{"text":"CQS / query purity"},"helpUri":"https://codehealth.canine.dev/dimensions/AX9"},{"id":"DM4","name":"Rich vs anemic domain model","shortDescription":{"text":"Rich vs anemic domain model"},"helpUri":"https://codehealth.canine.dev/dimensions/DM4"},{"id":"DM5","name":"Encapsulated state","shortDescription":{"text":"Encapsulated state"},"helpUri":"https://codehealth.canine.dev/dimensions/DM5"},{"id":"DM6","name":"Domain \u2194 infrastructure boundary","shortDescription":{"text":"Domain \u2194 infrastructure boundary"},"helpUri":"https://codehealth.canine.dev/dimensions/DM6"},{"id":"M1","name":"Documentation (README)","shortDescription":{"text":"Documentation (README)"},"helpUri":"https://codehealth.canine.dev/dimensions/M1"},{"id":"M2","name":"Architecture documentation","shortDescription":{"text":"Architecture documentation"},"helpUri":"https://codehealth.canine.dev/dimensions/M2"},{"id":"M3","name":"Folder \u0026 project structure","shortDescription":{"text":"Folder \u0026 project structure"},"helpUri":"https://codehealth.canine.dev/dimensions/M3"},{"id":"M4","name":"Documentation accuracy","shortDescription":{"text":"Documentation accuracy"},"helpUri":"https://codehealth.canine.dev/dimensions/M4"},{"id":"P1","name":"CI/CD gates","shortDescription":{"text":"CI/CD gates"},"helpUri":"https://codehealth.canine.dev/dimensions/P1"},{"id":"P2","name":"Observability","shortDescription":{"text":"Observability"},"helpUri":"https://codehealth.canine.dev/dimensions/P2"},{"id":"P3","name":"Security \u0026 performance tooling","shortDescription":{"text":"Security \u0026 performance tooling"},"helpUri":"https://codehealth.canine.dev/dimensions/P3"},{"id":"P5","name":"DR \u0026 Backup","shortDescription":{"text":"DR \u0026 Backup"},"helpUri":"https://codehealth.canine.dev/dimensions/P5"},{"id":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"S1","name":"Web-Security Posture","shortDescription":{"text":"Web-Security Posture"},"helpUri":"https://codehealth.canine.dev/dimensions/S1"},{"id":"X10","name":"Duplicated predicate","shortDescription":{"text":"Duplicated predicate"},"helpUri":"https://codehealth.canine.dev/dimensions/X10"},{"id":"X29","name":"Per-element action decided by a fixed element","shortDescription":{"text":"Per-element action decided by a fixed element"},"helpUri":"https://codehealth.canine.dev/dimensions/X29"},{"id":"X32","name":"Type resolved by simple name across every loaded assembly","shortDescription":{"text":"Type resolved by simple name across every loaded assembly"},"helpUri":"https://codehealth.canine.dev/dimensions/X32"},{"id":"X6","name":"Hand-rolled structured-format parsing","shortDescription":{"text":"Hand-rolled structured-format parsing"},"helpUri":"https://codehealth.canine.dev/dimensions/X6"},{"id":"X9","name":"Subsumed condition operand","shortDescription":{"text":"Subsumed condition operand"},"helpUri":"https://codehealth.canine.dev/dimensions/X9"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"(anonymous) (cyclomatic 158): (anonymous) has cyclomatic complexity 158 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 141 belong to 45 function items 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":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"c23db800cd406f8657147d2009c8a805a3aa7b8db62f9e0070a24d699c373ea3"}},{"ruleId":"D1","level":"warning","message":{"text":"(anonymous) (cyclomatic 136): (anonymous) has cyclomatic complexity 136 (threshold 15). Most of this is not in the body itself: 12 of the 136 points are its own statements and the rest belongs to 47 function items inside it that branch (buildRow, applyHighlight, buildFunctionCalls::(anonymous), \u2026). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/screenshot.js"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"c513643fb95c0e01b4aed1b3ce9a95f03d4a2e7af35423631bd8aaa6ef4f0cf4"}},{"ruleId":"D1","level":"warning","message":{"text":"LlamaServer.getChatCompletionInternal (cyclomatic 72): LlamaServer.getChatCompletionInternal has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6c64213f8ef250a4315880c35b127d1211afe79044df60c956c14d2e5fffebd"}},{"ruleId":"D1","level":"warning","message":{"text":"ChatParameters.toJSON (cyclomatic 37): ChatParameters.toJSON has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4d522a1e078cdab7fa19eea9dff178b14a3a414b8996ea1b76e18f288288e4d"}},{"ruleId":"D1","level":"warning","message":{"text":"Resource.updateIndex (cyclomatic 33): Resource.updateIndex 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":"Sidekick/Types/Expert/Resource.swift"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"78614329ea4393a53c9d5579352b6b7bd8fd4cdc9da3bbba053d129af55201d5"}},{"ruleId":"D1","level":"warning","message":{"text":"LlamaServerError.isContextWindowError (cyclomatic 28): LlamaServerError.isContextWindowError 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":"Sidekick/Logic/Inference/llama.cpp/Types/LlamaServerError.swift"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e2bed74c37f4433f147056808c144bc08c3da004274c71faa0a1acf5767e57a"}},{"ruleId":"D1","level":"warning","message":{"text":"String.modelParameterCount (cyclomatic 26): String.modelParameterCount 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":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"82f9d8de80719e1e0aa552ef4c5ebd190565f8298b3ab762c0d3432987791103"}},{"ruleId":"D1","level":"warning","message":{"text":"KnownModel.init (cyclomatic 25): KnownModel.init 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":"Sidekick/Types/Model/KnownModel.swift"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c6a53df4fd9849c7dea611522c2a0710e3ef76c0649a456e7951e62e039a25"}},{"ruleId":"D1","level":"warning","message":{"text":"RAGIndexingService.updateResourcesIndex (cyclomatic 23): RAGIndexingService.updateResourcesIndex 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":"Sidekick/Logic/Services/RAGIndexingService.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c1cabc10bba1ab84ec086072027c0d4234df653cc156785fd694eb1275d491"}},{"ruleId":"D1","level":"warning","message":{"text":"PromptInputField.generateChatResponse (cyclomatic 22): PromptInputField.generateChatResponse 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":"Sidekick/Views/Chat/Conversation/Controls/Input Field/PromptInputField.swift"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"514ce5e274756b38db1740d5a836c05ae4cf21a6912e471761d9a380e4d87705"}},{"ruleId":"D1","level":"warning","message":{"text":"ChatScreenshotHTMLBuilder.payload (cyclomatic 21): ChatScreenshotHTMLBuilder.payload 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":"Sidekick/Logic/Utilities/ChatScreenshotHTMLBuilder.swift"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb7a80bd29581c430a7f9593f82edded4ed3f49eb5ba2b265ec5bb31a04c15fc"}},{"ruleId":"D1","level":"warning","message":{"text":"DuckDuckGoSearch.search (cyclomatic 21): DuckDuckGoSearch.search has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"0799a1bce9dcdcd315f174591e9d5195f15233f4ee76b687b3d6d8e0ea11b2aa"}},{"ruleId":"D1","level":"warning","message":{"text":"Model.listenThinkRespond (cyclomatic 20): Model.listenThinkRespond 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":"Sidekick/Logic/Inference/Model.swift"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4d57dd564d30c7b2f39eff146092664b473555bd27b1894f3cc214b02b4f225"}},{"ruleId":"D1","level":"warning","message":{"text":"ChatParameters.init (cyclomatic 20): ChatParameters.init 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":"Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"40fc24e5563643da983510e681affaec45e2e4e63b7aabb75f81db8887ab48ef"}},{"ruleId":"D1","level":"warning","message":{"text":"LlamaServer.startServer (cyclomatic 17): LlamaServer.startServer 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":"Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"67c2f8ba58ad0f14569df98106c89371efd26ea2318a071920ad68bfb815760a"}},{"ruleId":"D2","level":"warning","message":{"text":"LlamaServer.getChatCompletionInternal (cognitive 192): LlamaServer.getChatCompletionInternal has cognitive complexity 192 (threshold 15). Drivers by points: if/else 48 (152 pts), error handling 3 (14 pts), loops 3 (8 pts), boolean chains 7, ternaries 4 (6 pts), match/switch 4 (5 pts) (nesting depth added 123). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"022e0be40a49c142d1e346cb8d0a7a54d1a4011ffc06774bb73f09c2561e4fc6"}},{"ruleId":"D2","level":"warning","message":{"text":"(anonymous) (cognitive 147): (anonymous) has cognitive complexity 147 (threshold 15). Drivers by points: if/else 57 (70 pts), boolean chains 54, error handling 10 (14 pts), loops 4, ternaries 4, match/switch 1 (nesting depth added 17). Most of this is not in the body itself: 8 of the 147 points are its own statements and the rest belongs to 47 function items inside it that branch (buildRow, applyHighlight, detectLanguageName, \u2026). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/screenshot.js"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bb96482aa9ea889fd1147b0d8df70450e98cff4928df58f957749d7fe2e2e4d"}},{"ruleId":"D2","level":"warning","message":{"text":"Resource.updateIndex (cognitive 68): Resource.updateIndex has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (47 pts), loops 4 (11 pts), boolean chains 6, error handling 2, match/switch 1, ternaries 1 (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":"Sidekick/Types/Expert/Resource.swift"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d20cc09202f1a984ee836d0f04ae94a075fb3918fdc04691346c93d9eb4018f"}},{"ruleId":"D2","level":"warning","message":{"text":"String.modelParameterCount (cognitive 52): String.modelParameterCount has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (42 pts), ternaries 1 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ec19096cf3025b00dee8d508281f4d203dbd401e4c7ec6a028b2392c5f6853d"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatParameters.toJSON (cognitive 36): ChatParameters.toJSON has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19, ternaries 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":"Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c1887ca720679e71330f6f63e0a1d1910610eba8d066223505856c6f0a55746"}},{"ruleId":"D2","level":"warning","message":{"text":"RAGIndexingService.updateResourcesIndex (cognitive 35): RAGIndexingService.updateResourcesIndex has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 4 (7 pts), boolean chains 4, 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":"Sidekick/Logic/Services/RAGIndexingService.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7c08c7a1494b4726b0f7c8ac5bc90864b5cad01d6b1748e85ad363b21bfbe7f"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphDatabase.loadGraph (cognitive 32): GraphDatabase.loadGraph has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (9 pts), boolean chains 3, error handling 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":"Sidekick/Logic/Utilities/GraphRAG/GraphDatabase.swift"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"27b8d3bdc7e50b206b45b38fa1a846840f155cf84742b2e7b1e400ec8f4483b9"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatScreenshotHTMLBuilder.payload (cognitive 31): ChatScreenshotHTMLBuilder.payload has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/ChatScreenshotHTMLBuilder.swift"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2782b40014c6c6fe04b79594b8aa71c7663be66ada66fd07a9fe6c3f8c5195c"}},{"ruleId":"D2","level":"warning","message":{"text":"LlamaServerError.isContextWindowError (cognitive 31): LlamaServerError.isContextWindowError has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (13 pts) (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":"Sidekick/Logic/Inference/llama.cpp/Types/LlamaServerError.swift"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"734169ea557e38e0e6d4aa179f4da40d561052a6b5faaa5aed53b251e5abf2e9"}},{"ruleId":"D2","level":"warning","message":{"text":"KnownModel.init (cognitive 30): KnownModel.init has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (14 pts), ternaries 1 (nesting depth added 5). 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":"Sidekick/Types/Model/KnownModel.swift"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"59ac0a40ff392da19db0f49fb9b888497362f13def345a9cd67b49dbba5b2fc4"}},{"ruleId":"D2","level":"warning","message":{"text":"String.familyVersion (cognitive 29): String.familyVersion has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (19 pts), ternaries 1 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":745}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ff55ec0cef23b42d2bcf23752334346e3f9d42e1a68a837266d3dca320ab12e"}},{"ruleId":"D2","level":"warning","message":{"text":"Model.listenThinkRespond (cognitive 28): Model.listenThinkRespond has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, error handling 1 (4 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/Model.swift"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c1ae5d8eec36cf92b252e52047da656e9c88b37717c18ee825cd28072ac7dda"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatParameters.init (cognitive 28): ChatParameters.init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, match/switch 2 (6 pts), loops 1 (3 pts), ternaries 1 (nesting depth added 7). 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":"Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bdda498872c553e31ed54b788afba625250cd52e33d9a42ad7b0e9d57628fbb"}},{"ruleId":"D2","level":"warning","message":{"text":"PromptInputField.generateChatResponse (cognitive 28): PromptInputField.generateChatResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, error handling 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/PromptInputField.swift"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4f2ed9224683c9dd9c39e7c39728679d6bebf3a07261a8ebdb8564c17fdd29c"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatScreenshotScope.resolve (cognitive 27): ChatScreenshotScope.resolve has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 16). 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":"Sidekick/Logic/Utilities/ChatScreenshotScope.swift"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"d652feede6a6f02e2a0e50d0ef17daf13ac0bde7aa12c2a5b3073947c3486207"}},{"ruleId":"D2","level":"warning","message":{"text":"GGUFMetadataReader.readArchitectureInfo (cognitive 27): GGUFMetadataReader.readArchitectureInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e438ce4a08d5367b2e329e9c726d107a26df3eabb346a24650f927e87358457"}},{"ruleId":"D2","level":"warning","message":{"text":"DuckDuckGoSearch.search (cognitive 27): DuckDuckGoSearch.search has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, 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":"Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"19e6032f1e473e6e44c32133b930c784e283fcdd5b20cb21a50e1dd343301e0f"}},{"ruleId":"D2","level":"warning","message":{"text":"Snapshot.extractCode (cognitive 26): Snapshot.extractCode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Canvas/Snapshot.swift"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f0e2d3cd5c64d2f08f5e1a94edbaded44bda98a835f101954d000518e16bcc0"}},{"ruleId":"D2","level":"warning","message":{"text":"GGUFMetadataReader.readChatTemplateInfo (cognitive 24): GGUFMetadataReader.readChatTemplateInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 pts), boolean chains 1, error handling 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":"Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"00478bf335ba57a69965194ea2d8a6781ca0aa82e0e876a8bf055b2f45041d72"}},{"ruleId":"D2","level":"warning","message":{"text":"CommunityDetector.detectBaseCommunities (cognitive 24): CommunityDetector.detectBaseCommunities has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 7 (12 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"95a7788364f4f4ec995d2a0cf58416a331dab8bec8ee42d515c63f4aa86056c7"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphDatabase.saveGraph (cognitive 24): GraphDatabase.saveGraph has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 4 (8 pts), error handling 1 (nesting depth added 13). 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":"Sidekick/Logic/Utilities/GraphRAG/GraphDatabase.swift"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cb5484e3e87a1083f32cf1d5c3dc48a22abb52a6c5701665f50af34f7803ff2"}},{"ruleId":"D2","level":"warning","message":{"text":"MessageSubset.init (cognitive 23): MessageSubset.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), 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":"Sidekick/Types/Conversation/Message/Message.swift"},"region":{"startLine":437}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c20a11b5a8f30e5f305c148dc2c764f531fdb7503bd395910dd2f8254476cd5"}},{"ruleId":"D2","level":"warning","message":{"text":"LlamaServer.startServer (cognitive 22): LlamaServer.startServer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 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":"Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcad6df173eb5884b2a21ff2ad70520fd598c09d542d9d96754135951fa70580"}},{"ruleId":"D2","level":"warning","message":{"text":"CommunityDetector.detectCommunities (cognitive 22): CommunityDetector.detectCommunities has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (11 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"8953f44b6dd90de9872c1e3e84917799ce478a7cd9022ab9a0c00eb4077255ff"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphRetriever.retrieve (cognitive 22): GraphRetriever.retrieve has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/GraphRetriever.swift"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"e633015b091b5599374f2255d13938f9af72de5b81e0800a6e711260de1b74b6"}},{"ruleId":"D2","level":"warning","message":{"text":"String.modelProvider (cognitive 18): String.modelProvider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":780}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c635baca5e5eb08828c909f15b53ef5c71e3626197d2e8948528001641a5504"}},{"ruleId":"D2","level":"warning","message":{"text":"chat.renderIncremental (cognitive 18): chat.renderIncremental has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3, boolean chains 1, ternaries 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":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"61b0cd8d35b5a717c402b6171793adb1a43b9713e25ccd9a7636cb4ca755144a"}},{"ruleId":"D2","level":"warning","message":{"text":"(anonymous)::renderIncremental (cognitive 18): (anonymous)::renderIncremental has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3, boolean chains 1, ternaries 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":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"653dd183c413a1308567889dac7cf5e4eeb457a71c22507475361083ee8cbeca"}},{"ruleId":"D2","level":"warning","message":{"text":"(anonymous)::fullHighlightInside (cognitive 18): (anonymous)::fullHighlightInside has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c02e3a95e10dce21180e1d8addf73a5dd7dd7bdfbd6edfa9ed6895b20c16f8d"}},{"ruleId":"D2","level":"warning","message":{"text":"Model.displayedPendingMessage (cognitive 17): Model.displayedPendingMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), 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":"Sidekick/Logic/Inference/Model.swift"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1a2f532de80035f6cddfbbfeebd4794e274407dcfe22ece823371c5a9d01ecd"}},{"ruleId":"D2","level":"warning","message":{"text":"KnownModel.findModel (cognitive 17): KnownModel.findModel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, 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":"Sidekick/Types/Model/KnownModel.swift"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbbbf5590d3487a2ae1efa59783643080415fb32db9e7ced20ec586732b21364"}},{"ruleId":"D2","level":"warning","message":{"text":"ModelSelectorDropdown.dropdownContent (cognitive 17): ModelSelectorDropdown.dropdownContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 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":"Sidekick/Views/Model/ModelSelectorDropdown.swift"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"92434060c16b7a8f22bf0d6c02880e79c26afa6121922a212de5b23119dec0c6"}},{"ruleId":"D2","level":"warning","message":{"text":"ModelSelectionView.body (cognitive 17): ModelSelectionView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \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":"Sidekick/Views/Setup/ModelSelectionView.swift"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"cca5422d26bbd0ae20e6aaee6a0073c65853683dfd9cb23c716e7a485eb6ffe7"}},{"ruleId":"D2","level":"warning","message":{"text":"DuckDuckGoSearch.decodeHTMLEntities (cognitive 17): DuckDuckGoSearch.decodeHTMLEntities has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), 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":"Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c3a2a7e16ee03ce668f01880dc8308977f54491a3ddb17c4b0275a95d64de38"}},{"ruleId":"D2","level":"warning","message":{"text":"Site.extractSite (cognitive 17): Site.extractSite has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 1 (4 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Canvas/Snapshot.swift"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"5594d6ad0d8b2f866207c4a8e9b93432787f7751458b1de707b59854a391e59c"}},{"ruleId":"D2","level":"warning","message":{"text":"AssetResolver.resolve (cognitive 17): AssetResolver.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 2 (4 pts), 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":"Sidekick/Views/Chat/Markdown/ChatMarkdownAssetSchemeHandler.swift"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"0475eabab70a7577ae08eafc34bdd77f296faa1e583adb3d43e6ee158c37b894"}},{"ruleId":"D2","level":"warning","message":{"text":"MultilineTextField.updateNSView (cognitive 17): MultilineTextField.updateNSView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \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":"Sidekick/Views/Chat/Conversation/Controls/Input Field/MultilineTextEditor.swift"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb617ded96ae3e4dd01114baca88e7e1b81ad251b013da714dbee7adadc36ae"}},{"ruleId":"D2","level":"warning","message":{"text":"MessageContentView.textContent (cognitive 17): MessageContentView.textContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageContentView.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d199b80df0a283c0e9a2d0ead2786bba3a67670494b4223617544d6de321511"}},{"ruleId":"D2","level":"warning","message":{"text":"MermaidRenderer.render (cognitive 16): MermaidRenderer.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, error handling 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":"Sidekick/Logic/Utilities/Tools/MermaidRenderer/MermaidRenderer.swift"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cc50822f28ce79c75616f7d233388f33fc98527988c0778a8148ff8c7e1342f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.swift.checkHeartbeat (cognitive 16): main.swift.checkHeartbeat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/llama-server-watchdog/main.swift"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"905a3ebcc5839eeab7f4439cc093ef60a0a550e7d7f974eb32acfdd772252114"}},{"ruleId":"D2","level":"warning","message":{"text":"chat.groupTopLevel (cognitive 16): chat.groupTopLevel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"37c7dd6d2b7b2c398d9585cabdf94ad26514546a3e5358ed252ec2e2f8ecaf77"}},{"ruleId":"D2","level":"warning","message":{"text":"(anonymous)::groupTopLevel (cognitive 16): (anonymous)::groupTopLevel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae763382836cafb966227fca2c0de8081c526edd18a78387ef30f07b81fa0460"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Resource.updateIndex: MethodTooLong \u2014 updateIndex runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Expert/Resource.swift"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdd15ad0fe267cd1fe08946f287693be0836cc788a841ea08bee0ee71b4ab6bb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Model: TooManyMethods \u2014 49 methods. The bar is 30 methods; this is 19 over it, 1.63\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/Model.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"7712114aac072f504611e4ee9335c250b76132a5da1fd6ba6c2fed0f48f9a90a"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: DeepResearchAgent: ClassTooLong \u2014 622 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 222 over it, 1.56\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Agent/DeepResearchAgent.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8f623265a883e694533bcdc4306af60219c561da591238ed54f716c909ae155"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: PromptInputField: ClassTooLong \u2014 610 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 210 over it, 1.53\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/PromptInputField.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c6281f8a18a14c52f48f26686e89b857c791c9958c95e32dc499087c117ab9d"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: RAGIndexingService.updateResourcesIndex: MethodTooLong \u2014 updateResourcesIndex runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Services/RAGIndexingService.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e1b0fa501e2beca87fa5987cc1b786f547ac50df86d948c5ca81415f5e3eb71"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: llama.cpp/LlamaServer\u002BChat.swift: FileTooLong \u2014 704 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 204 over it, 1.41\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/LlamaServer\u002BChat.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"47c4b9b1f30103b470d5effd8a94b0c8499e6a4761d69594c25422b5ece903a9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Agent/DeepResearchAgent.swift: FileTooLong \u2014 626 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: DeepResearchAgent (13-1008). The bar is 500 significant lines; this is 126 over it, 1.25\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \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":"Sidekick/Types/Agent/DeepResearchAgent.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8fcbd68e3db91a61c3c1618f74b194507aef8ae44ebf57f9f9b9c4c2d557ae1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Input Field/PromptInputField.swift: FileTooLong \u2014 615 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: PromptInputField (14-963). The bar is 500 significant lines; this is 115 over it, 1.23\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \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":"Sidekick/Views/Chat/Conversation/Controls/Input Field/PromptInputField.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"80b4f9d9f1f4465af1aaf88606475131d1a67d0a9ce2e6c6b3e073a47219da14"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: PromptInputField.generateChatResponse: MethodTooLong \u2014 generateChatResponse runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/PromptInputField.swift"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"21ac7d0a8f52ca8456e334fdef75380a1d6e1208c34fd34b059f6e081b2455b6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ChatMarkdownWebView/chat.js: FileTooLong \u2014 584 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 84 over it, 1.17\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c06248c013bef288664d470053d2480899491635b921abc2f82b83dfa16003"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Resource: ClassTooLong \u2014 450 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 50 over it, 1.13\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Expert/Resource.swift"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"b243d184d876208cbeeed199bb27d845c03e661f44c4b3cb2c1c2236749af5f2"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Theme.gitHub: MethodTooLong \u2014 gitHub runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/UI/Extension\u002BTheme.swift"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8859b27bf2171627a2d9baa0d25b2de297e70d970622f80ff7b69023e687314"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: DeepResearchAgent.researchSection: MethodTooLong \u2014 researchSection runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Agent/DeepResearchAgent.swift"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"52d0e0cd5e8a56c3bacc0882403e35dd44320dd26cc2a9ca80fb05eab3f82fb5"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: ModelLoadConfigSheet: ClassTooLong \u2014 408 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 8 over it, 1.02\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Settings/Model/ModelLoadConfigSheet.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1b1f3c38607f3aa52aae3e2f151c3b42b0b97fe9abd1986804eab416a9f1eb4"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:369-406 | Sidekick/Logic/Utilities/GraphRAG/EntityExtractor.swift:257-291 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"f11d0987a12298c76adc11b823daf11ac97927a626e79b0d8a0cacc48847d12f"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (6 members, 50\u002B identical tokens): Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:34-65 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:70-104 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:107-146 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:149-161 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:164-176 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:179-191 \u2014 These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9f16dc65c16104072628a7f6f1e9c6d0b82287ac2d886080a26d173b65cf074"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): Sidekick/Views/Expert/Resource/ResourceSectionView.swift:120-134 | Sidekick/Views/Settings/GeneralSettingsView.swift:109-122 | Sidekick/Views/Settings/GeneralSettingsView.swift:124-137 | Sidekick/Views/Settings/GeneralSettingsView.swift:163-177 | Sidekick/Views/Settings/InferenceSettingsView.swift:302-314 \u2014 These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Expert/Resource/ResourceSectionView.swift"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc28d598d0d0ed6b80bdd963c4eda0cb06565f49a87b0dc743322c23ca1603c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): Sidekick/Logic/Data Models/ModelManager.swift:215-241 | Sidekick/Logic/Persistence/SidekickSchema.swift:152-184 | Sidekick/Logic/Persistence/SidekickSchema.swift:420-450 | Sidekick/Types/Conversation/Message/Message.swift:729-763 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Data Models/ModelManager.swift"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"566a6b5658285f9534208a2c1abea2a8b311f00542ab3c366771cecae3cb67bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift:61-78 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:69-94 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageView.swift:194-212 | Sidekick/Views/Chat/Conversation/Messages/Options/SourcesButton.swift:15-30 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dc4c3aeca8fd344c3f1ec89b241307118f0c51f70120a7ce3f98916db4d3e0e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35 lines \u00D7 2): Sidekick/Views/Model/ModelSelectorDropdown.swift:635-669 | Sidekick/Views/Model/ModelSelectorDropdown.swift:689-723 \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 \u0060Sidekick/Views/Model/ModelSelectorDropdown.swift:635\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":"Sidekick/Views/Model/ModelSelectorDropdown.swift"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac96847974601287c08398dbfa356a3a43152f2aaffa5a0cdd4803b61db7ba26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22\u201325 lines \u00D7 2): Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:69-90 | Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:165-189 \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 \u0060Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:69\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":"Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"135aa487540b3a103f73c43e74848bb85433046e223f99ac1ba93847d286cb42"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): Sidekick/Logic/Data Models/ModelManager.swift:216-238 | Sidekick/Logic/Persistence/SidekickSchema.swift:423-445 \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 \u0060Sidekick/Logic/Data Models/ModelManager.swift:216\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060Sidekick/Logic/Persistence/SidekickSchema.swift:421\u0060 calls \u0060UUID\u0060 and \u0060Sidekick/Logic/Data Models/ModelManager.swift:215\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Data Models/ModelManager.swift"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"533d9e4c838e3737537258fd85928b40b8c6cdfbf4f302dba0df0a11beed1406"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift:58-79 | Sidekick/Views/Styles/ChatStyle.swift:39-60 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift:58\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"d376e9cc70c8936e094710c0ef33d8599bafab68f0adffed70345a5daf2662aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:128-149 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:159-180 \u2014 before extracting anything, compare \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"17c830238b12fd5cfb4082b74bfca63a121af0c8c39414020931992331b15b23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift:81-101 | Sidekick/Views/Styles/ChatStyle.swift:62-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 \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift:81\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/ChatPromptEditor.swift"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c7e85a1912e6c24ccc4c658e0228e49e82a0354b05098719f58856f1d75248"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): Sidekick/Logic/Utilities/Tavily.swift:87-106 | Sidekick/Logic/Utilities/Tavily.swift:168-187 \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 \u0060Sidekick/Logic/Utilities/Tavily.swift:87\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":"Sidekick/Logic/Utilities/Tavily.swift"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"541ee4725a6acb7a592b56628d78281a773ef2ac320cc9286b6c8c3fbf13f523"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Canvas/Snapshot/SnapshotExportButton.swift:121-139 | Sidekick/Views/Chat/Conversation/Canvas/Snapshot/SnapshotExportButton.swift:258-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. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060alignment\u0060 to \u0060.bottom\u0060 in one and \u0060.leading\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Canvas/Snapshot/SnapshotExportButton.swift"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"846737adf6f965701bd21482ffa68a40f5934674b6c9e543d3e02c28deb3fe3b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): Sidekick/Logic/Inference/Model\u002BInference.swift:602-620 | Sidekick/Logic/Inference/Model\u002BInference.swift:794-812 \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 \u0060Sidekick/Logic/Inference/Model\u002BInference.swift:602\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":"Sidekick/Logic/Inference/Model\u002BInference.swift"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaa935053979e3250e09652ece38ecac699be8b49dda5213a703461e73d36d79"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201318 lines \u00D7 4): Sidekick/Logic/Data Models/ModelManager.swift:228-241 | Sidekick/Logic/Persistence/SidekickSchema.swift:168-184 | Sidekick/Logic/Persistence/SidekickSchema.swift:435-450 | Sidekick/Types/Conversation/Message/Message.swift:746-763 \u2014 there are 4 copies across 3 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Logic/Data Models/ModelManager.swift: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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Data Models/ModelManager.swift"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ec32a50e5e1a12030f2bee6fdb28c16ac8040fffbe7b5ab388cbc0eecd12330"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): Sidekick/Views/Settings/InferenceSettingsView.swift:145-162 | Sidekick/Views/Settings/InferenceSettingsView.swift:219-236 \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 \u0060Sidekick/Views/Settings/InferenceSettingsView.swift:145\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":"Sidekick/Views/Settings/InferenceSettingsView.swift"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"a79202bc6a78ecf1268486b3509569c6322b9184f7cba817db484d9846e07970"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): Sidekick/Logic/Inference/Model\u002BInference.swift:396-412 | Sidekick/Logic/Inference/Model\u002BInference.swift:640-656 \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 \u0060Sidekick/Logic/Inference/Model\u002BInference.swift:396\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/Model\u002BInference.swift"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"88f0f65faa69f0d24da243015f6065b0850e9d550088f51d4bd8b952cb69c451"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 2): Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:324-338 | Sidekick/Logic/Utilities/GraphRAG/EntityExtractor.swift:199-214 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cbe86ed8b824a19ce9caee2ae7cb301e06a707c38154da1f70d3e6dcaa89471"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:50-65 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:51-66 \u2014 before extracting anything, compare \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e1270625644daee9cff308fe060f47821b0b2273bcdc6b8f96aa2285e04189f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201315 lines \u00D7 2): Sidekick/Views/Chat/Conversation/ChatStyle.swift:27-34 | Sidekick/Views/Styles/ChatStyle.swift:96-110 \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 \u0060Sidekick/Views/Chat/Conversation/ChatStyle.swift:27\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":"Sidekick/Views/Chat/Conversation/ChatStyle.swift"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a4d2025b314e155b1f28e921cfe897fabc583c5dee9df269434ec5acf5c4af1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:308-322 | Sidekick/Logic/Utilities/GraphRAG/EntityExtractor.swift:184-198 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"4915b989c2858952a611a5e80c1df7ebef02eab3247e754d9b62482d17618cd1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:256-270 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageView.swift:305-319 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:256\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"49b1ff914176d33b382a69f50e7bcd0a80733679feab234f39021d9e1e0ccc97"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): Sidekick/Logic/Inference/Model\u002BInference.swift:440-454 | Sidekick/Logic/Inference/Model\u002BInference.swift:681-695 \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 \u0060Sidekick/Logic/Inference/Model\u002BInference.swift:440\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":"Sidekick/Logic/Inference/Model\u002BInference.swift"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8a7dc1356805a6726ba8f84e6321d18955de76bb5be7c5f493ccfee0e2e87c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:48-61 | Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:105-118 | Sidekick/Logic/Utilities/GraphRAG/EntityExtractor.swift:88-101 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ca79f3eab9eb42f0b36d24ce7f121c662ed0b1bd0eaf17bbe3bc73253ef3e4a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:189-202 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:215-228 \u2014 before extracting anything, compare \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:186\u0060 calls \u0060createChecklistMenu\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:213\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"c22f5bc0369d5c4723e7de8ebaa23d8087020b1045b0f0c50159653f11d2fecc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201314 lines \u00D7 2): Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:38-50 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:74-87 \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 \u0060Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:38\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":"Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba852889ad44405e940eeba0fd8590c37416c1f220d0cdb7686a7c257ad91231"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 2): Sidekick/Logic/Data Models/ExpertManager.swift:243-254 | Sidekick/Logic/Persistence/JSONImporter.swift:248-260 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Logic/Data Models/ExpertManager.swift:243\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":"Sidekick/Logic/Data Models/ExpertManager.swift"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bdd946c860fbd836b4fb06379bef4392f9afbf7ea0c7b5cb4b59151e36972f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sidekick/Logic/Data Models/ModelManager.swift:124-135 | Sidekick/Logic/Data Models/ServerArgumentsManager.swift:129-140 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Logic/Data Models/ModelManager.swift:124\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"Sidekick/Logic/Data Models/ModelManager.swift"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"954fde614b4008930df4dccd0480206000f67c9595e30a72fc0954683a028d67"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sidekick/Views/Misc/ScrollMask.swift:14-25 | Sidekick/Views/Misc/ScrollMask.swift:27-38 \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":"Sidekick/Views/Misc/ScrollMask.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7c73d3be4c66b3ca7aad2d0fcaa87e2c1fa39e28d16785b041fef30e24a2e06"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sidekick/Views/Model/ModelSelectorDropdown.swift:272-283 | Sidekick/Views/Settings/Model/ModelNameMenu.swift:128-139 \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 \u0060Sidekick/Views/Model/ModelSelectorDropdown.swift:272\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"Sidekick/Views/Model/ModelSelectorDropdown.swift"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2660b35183dc7eb1eed7fe90e1ce2a7a253cf1ddd799309438e3b8b04deb275"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sidekick/Views/Settings/Model/ServerModelSettingsView.swift:56-67 | Sidekick/Views/Settings/Model/ServerModelSettingsView.swift:153-164 \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 \u0060Sidekick/Views/Settings/Model/ServerModelSettingsView.swift:56\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":"Sidekick/Views/Settings/Model/ServerModelSettingsView.swift"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8881d900ed64fc69d83f1e6acece92dd65c25d67822bdca52315ea5007ab845"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sidekick/Extensions/UI/Extension\u002BTheme.swift:50-61 | Sidekick/Extensions/UI/Extension\u002BTheme.swift:63-74 \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 \u0060Sidekick/Extensions/UI/Extension\u002BTheme.swift:50\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"Sidekick/Extensions/UI/Extension\u002BTheme.swift"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f4fce8c521a9f232c11cd4530af70d12f10fa2b073c0968b1cecd2428f663ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 2): Sidekick/Logic/Data Models/InferenceRecords.swift:34-44 | Sidekick/Logic/Persistence/JSONImporter.swift:374-383 \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 \u0060Sidekick/Logic/Persistence/JSONImporter.swift:374\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":"Sidekick/Logic/Data Models/InferenceRecords.swift"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"fde892b3f58eecf1b4a9f5538c8cd0c2c0625238f6a43bba133e1692583778d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sidekick/Views/Settings/RetrievalSettingsView.swift:191-201 | Sidekick/Views/Settings/RetrievalSettingsView.swift:216-226 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Settings/RetrievalSettingsView.swift:191\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":"Sidekick/Views/Settings/RetrievalSettingsView.swift"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"106eff46878ea459c2e5646fc8f93d78d04d5e5b50736f8f37bb185c55ee2775"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:379-389 | Sidekick/Logic/Utilities/GraphRAG/EntityExtractor.swift:267-277 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift:379\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":"Sidekick/Logic/Utilities/GraphRAG/CommunityDetector.swift"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"05dc07852b44d60ad176181af59b56252298c16b31c4169d15bc6265deead04b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:93-103 | Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:129-139 \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 \u0060Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:93\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:141\u0060 calls \u0060frame\u0060 and \u0060Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:105\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a5c927fb844512ca64ce938378d55a8c0be8171f0befab6392bc723ad8f7cc9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift:118-128 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageStepsView.swift:107-117 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift:118\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageStepsView.swift:118\u0060 calls \u0060frame\u0060 and \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift:129\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9a4c87f7584ca77678741caeaa1ba063955dd905a5e19f07ac9f432b39d9e66"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sidekick/Logic/Inference/llama.cpp/LlamaServer\u002BChat.swift:63-73 | Sidekick/Logic/Inference/llama.cpp/LlamaServer\u002BChat.swift:104-114 \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":"Sidekick/Logic/Inference/llama.cpp/LlamaServer\u002BChat.swift"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa42eda80ccd01e27b0cbb28e3645142ab42fe9d65336260a5a174607a69f8c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 5): Sidekick/Views/Expert/Resource/ResourceSectionView.swift:120-129 | Sidekick/Views/Settings/GeneralSettingsView.swift:109-118 | Sidekick/Views/Settings/GeneralSettingsView.swift:124-133 | Sidekick/Views/Settings/GeneralSettingsView.swift:163-172 | Sidekick/Views/Settings/InferenceSettingsView.swift:302-311 \u2014 there are 5 copies across 3 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Expert/Resource/ResourceSectionView.swift:120\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Settings/GeneralSettingsView.swift:175\u0060 calls \u0060disabled\u0060 and \u0060Sidekick/Views/Settings/GeneralSettingsView.swift:121\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Expert/Resource/ResourceSectionView.swift"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a7be04d1ca5901c245018b0ac8e58e33b2ee73d922a673ecbf4f8172048ae35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:89-98 | Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift:125-134 | Sidekick/Views/Chat/Markdown/MarkdownCodeBlockView.swift:137-146 \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 \u0060Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift: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":"Sidekick/Views/Chat/Conversation/Messages/Message/CollapsibleUserMessageView.swift"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"708781f35fac66f8cecb3cafcc1b4361e52d2e2474bc2d68363a3a20b820bba3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:152-161 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:167-176 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:182-191 \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 \u0060Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:152\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"205cd61489436a69a65d191d8e0a39256c1aada72472286a0887d4bb544c49f2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sidekick/Views/Settings/Model/ServerModelSettingsView.swift:133-142 | Sidekick/Views/Settings/RetrievalSettingsView.swift:163-172 \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 \u0060Sidekick/Views/Settings/Model/ServerModelSettingsView.swift: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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Settings/Model/ServerModelSettingsView.swift:144\u0060 calls \u0060textContentType\u0060 and \u0060Sidekick/Views/Settings/RetrievalSettingsView.swift:174\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Settings/Model/ServerModelSettingsView.swift"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"1885a151199146f3f1cd39cccc7ac0d4306157d30cc747dd5cf44530c303fcd2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:96-104 | Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:192-201 \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 \u0060Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift:96\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":"Sidekick/Logic/Inference/llama.cpp/GGUFMetadataReader.swift"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a495d75ed824374feb13380d93b1f70e49a83a5082e0508098ba86ffa74ad4f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201310 lines \u00D7 2): Sidekick/Types/Conversation/Functions/Default Functions/WebFunctions.swift:123-132 | Sidekick/Types/Conversation/Message/Message.swift:194-201 \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":"Sidekick/Types/Conversation/Functions/Default Functions/WebFunctions.swift"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"842e7415c24e0ce1bd2d74267bc4ca8def4f91cc1237ab200688bb78a77b5082"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift:99-108 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageStepsView.swift:94-103 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift:99\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":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageReasoningProcessView.swift"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff01d9b2e6269d25132a09c2a0ba2d45d103f7ecb38badea1a6f75fff8e6ff35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 3): Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:36-43 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:72-80 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:180-188 \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 \u0060Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:36\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"d499056696c7bba4cd9d114ada98d03002c83d8478d0f002864c1e28f56ab7e5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 3): Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:109-116 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:150-158 | Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift:165-173 \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 \u0060Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift: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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/AppKit/Extension\u002BNSMutableAttributedString.swift"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"9319ef8ea4454c64c6479982c95077545c08489252134f9c5a2907d11b13c81d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): Sidekick/Logic/Data Models/ConversationManager.swift:154-162 | Sidekick/Logic/Data Models/Memories.swift:113-120 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Logic/Data Models/ConversationManager.swift:154\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. 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":"Sidekick/Logic/Data Models/ConversationManager.swift"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3eb84eb2227058f62d0356e4f688a855b0138fdc6d69385d57fc180e8efe7a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:72-79 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageView.swift:199-206 | Sidekick/Views/Chat/Conversation/Messages/Options/SourcesButton.swift:18-25 \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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:72\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:81\u0060 calls \u0060foregroundStyle\u0060 and \u0060Sidekick/Views/Chat/Conversation/Messages/Options/SourcesButton.swift:27\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"32786b7384119783e602ff2be5ea32e4f1d986aabe9f47a31d91713c30222e15"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sidekick/Logic/Utilities/ChatScreenshotHTMLBuilder.swift:221-228 | Sidekick/Views/Chat/Conversation/Messages/Message/FunctionCallsView.swift:116-127 \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 \u0060Sidekick/Logic/Utilities/ChatScreenshotHTMLBuilder.swift:221\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":"Sidekick/Logic/Utilities/ChatScreenshotHTMLBuilder.swift"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"642ada33f6fc1a186117cbce8b70dca17b1379ac3310972f14caeba598739410"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sidekick/Logic/Utilities/ChatScreenshotRenderer.swift:565-572 | Sidekick/Logic/Utilities/ChatScreenshotRenderer.swift:575-582 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/ChatScreenshotRenderer.swift"},"region":{"startLine":565}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ac97c72d6ba473084b1bfe8c4752500ba78fd3e322d252f40be8b069fbaf60d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift:67-73 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageOptionsView.swift:74-80 | Sidekick/Views/Chat/Conversation/Messages/Message/MessageView.swift:201-207 | Sidekick/Views/Chat/Conversation/Messages/Options/SourcesButton.swift:20-26 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift:67\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift:75\u0060 calls \u0060scaleEffect\u0060 and \u0060Sidekick/Views/Chat/Conversation/Messages/Message/MessageView.swift:209\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Messages/Message/MessageCopyButton.swift"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb07d23367a7ef0ccb1e8f0c3991bd1c8ae44f8dd56d064f9a28712d3918dc41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sidekick/Extensions/Extension\u002BString.swift:625-631 | Sidekick/Extensions/Extension\u002BString.swift:751-757 \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 \u0060Sidekick/Extensions/Extension\u002BString.swift:625\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":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":625}}}],"partialFingerprints":{"codehealthFindingId/v1":"5742f59aa9f12f18e90d8cf7fe75e3ffcd899dcd2d5ac38843f0fea93a6c3385"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): Sidekick/Extensions/Extension\u002BIndexItem.swift:14-32 | Sidekick/Types/Conversation/Message/SearchResult.swift:13-51 \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":"Sidekick/Extensions/Extension\u002BIndexItem.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2468fc7a5a027dec74c0a8aac61db8c909619092bf66b41acd594ea3f9a4f70"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sidekick/Types/Conversation/Message/ReferencedURL.swift:20-26 | Sidekick/Types/Conversation/TemporaryResource.swift:32-38 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, 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":"Sidekick/Types/Conversation/Message/ReferencedURL.swift"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0e2d9d466f6c5ede9311c8635366bc6580a15a78482b20794ff6e67c52daefc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): Sidekick/Views/Expert/ExpertEditorView.swift:22-31 | Sidekick/Views/Expert/Resource/ResourceSectionView.swift:24-33 | Sidekick/Views/Expert/Resource/ResourceSelectionView.swift:62-71 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Expert/ExpertEditorView.swift"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2d916fafd6cb741e504b1afb806df0d09429ddedc706dc0c5b8e5b4e79b58f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sidekick/Types/Conversation/Functions/Function.swift:270-279 | Sidekick/Types/Conversation/Functions/FunctionCallRecord.swift:41-50 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Functions/Function.swift"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"6984530c568e0332e9ae3b4f2fb7733ddd5342d233cd2001fcf9958135cd778e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sidekick/Extensions/UI/Extension\u002BBinding.swift:85-94 | Sidekick/Views/Expert/Resource/ResourceSectionView.swift:342-351 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/UI/Extension\u002BBinding.swift"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"410022b8c92fa662a19c4a0f60ee4717f2f6482bdf43cf387015770f8040171c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleButton.swift:46-58 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:94-106 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:99-111 \u2014 before extracting anything, compare \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleButton.swift"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"a54fc83232ae417e48d7c2e80d542bb66c6ee5c3ee61c6b28934942f88f45d3b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleButton.swift:60-69 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift:108-117 | Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift:113-122 \u2014 before extracting anything, compare \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift\u0060 and \u0060Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleMenuButton.swift\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleButton.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"d240b466745f2a8c324c3e2a604ec34c78bae777dd75ebc4185d6a14559713e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift:70-77 | Sidekick/Types/Conversation/Functions/Default Functions/ReminderFunctions.swift:78-85 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"e400ba1db5f71c52f25c5920fc2f9c0ea6f1678e40ab7092dc4b475898a79e2e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift:80-91 | Sidekick/Types/Conversation/Functions/Default Functions/ReminderFunctions.swift:88-96 | Sidekick/Types/Conversation/Functions/Default Functions/WebFunctions.swift:53-64 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 3 call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf8a84d5ea2e11a01dd47978a2f5d4d6273635ecf5cecd2d902e6c720b01a440"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift:56-65 | Sidekick/Types/Conversation/Functions/Default Functions/ReminderFunctions.swift:63-72 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Types/Conversation/Functions/Default Functions/CalendarFunctions.swift"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae18fc06d4cb02d830c2c4f9ce7cf17a0870b991e6156c073ed2b301c7128919"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift:58-62 | Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift:73-77 \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 \u0060Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift:58\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Utilities/Web/DuckDuckGoSearch.swift"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"150d4232606b1e3d33b08e4291a56080ef7eb523d9a7861ab27808a6af891a7a"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: String (LCOM4 22): String\u0027s methods fall into 22 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 22 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BString.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef3030d7551993e1da29d33d2cc053e926709b0f7a14a6d4fb77204b3ea1de83"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: PromptController (LCOM4 5): PromptController\u0027s methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/View Controllers/PromptController.swift"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"891663ee341d5a10d2977a8577bc596571a4c7bd763af639f33122954f340a84"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: URL (LCOM4 5): URL\u0027s methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BURL.swift"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a5c03fd28a5000921710ecc07f0f0c6e94622f94ee9a79d383a964f2ea0826"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Coordinator (LCOM4 4): Coordinator\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/CapsuleChecklistMenuButton.swift"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"843bab20662d9a99e85f45e1624551aa420a41964e3c654d1f9fd45fbf5880be"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: PromptingTextView (LCOM4 4): PromptingTextView\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Views/Chat/Conversation/Controls/Input Field/MultilineTextEditor.swift"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d0b9461010561c9b2783ff6ddcc7748946b19b6efe7648864aa6167709b11d4"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Array (LCOM4 4): Array\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Extensions/Extension\u002BArray.swift"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f8a7ac1ce1244a74c254f4eb1c1f13cf9c42933395031fc3ea13e32cdb41ab9"}},{"ruleId":"D10","level":"warning","message":{"text":"No assertions: checkModelReccomendations: This method\u0027s body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* \u2014 so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as \u0027no assertion this check knows how to see\u0027, and if that is right, add one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"SidekickTests/SidekickTests.swift"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e7c8141eab3d57f864b0daa63974a7f93bc4d2775547240a5b61da6e7ab3463"}},{"ruleId":"D10","level":"error","message":{"text":"Assertions commented out: testExample: The test body contains commented-out assertion calls and no live one \u2014 it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"SidekickUITests/SidekickUITests.swift"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"011df058fef211eab99e03d07fc3deae8f16a9b40fb32806e019c717741ed018"}},{"ruleId":"D10","level":"warning","message":{"text":"No assertions: testLaunchPerformance: This method\u0027s body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* \u2014 so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as \u0027no assertion this check knows how to see\u0027, and if that is right, add one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"SidekickUITests/SidekickUITests.swift"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"abbcfe53cdacc8c190527ab5c814ac28c7a3828cbebfdeec7f6d3d1af3d84a94"}},{"ruleId":"D10","level":"warning","message":{"text":"No assertions: testLaunch: This method\u0027s body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* \u2014 so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as \u0027no assertion this check knows how to see\u0027, and if that is right, add one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"SidekickUITests/SidekickUITestsLaunchTests.swift"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5cf6fdf72fb68f9bbe8db2d9f06e36405e7997d7b4524e0cc3adc6de25391f7"}},{"ruleId":"D10","level":"error","message":{"text":"Test project verifies nothing: SidekickUITests: No conventional assertion call was detected in 3 of 3 tests in \u0060SidekickUITests\u0060 \u2014 the project as a whole, not one method. 1 of them has its assertions commented out, so this suite did verify conventionally and was switched off \u2014 it is not an approval/verifier harness."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"SidekickUITests/SidekickUITests.swift"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ea05df6daad0dba9d923096c9be324278323538f58b6d2abf0ff946fd510f48"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: default-models: Dependency \u0060default-models\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"492f504b0a502d40cdd85bdd97469b53da77bb95d37ea5344e06c60b91a9fb16"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: eventsource: Dependency \u0060eventsource\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"b9e56a3f5970a5e87ee2140f2225d78be2368998d45e1e7a047cf4b944e778f2"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: extractkit-macos: Dependency \u0060extractkit-macos\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"f2c9edb3b0333422527eb21d55a711bd23137c50959c0ae8ec841956751ddd40"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: fskit-macos: Dependency \u0060fskit-macos\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"c02698525e82fc58e71ae352dd6a769f21b7b8dfba18d7bf37119073ef2274c1"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: googlesearch: Dependency \u0060googlesearch\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"837e53fd99bafcde60c912771abe59b0f2584c2399c1320ca0dbc61afd2c34df"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: latexswiftui: Dependency \u0060latexswiftui\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"71b29521be032b0ae0295f95bd2111608565235eb8cfd75e3a655a11adc9224b"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: launchatlogin-modern: Dependency \u0060launchatlogin-modern\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"abc8b2ae180d5d7023f4ebcf3eef559d9eec562e6c5d67c09e8fb67d308ef0d8"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: similarity-search-kit: Dependency \u0060similarity-search-kit\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060main\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"0191658cdff47b962bcd9758d574b93f2ab5990c09cf68847abf0b07ddb986b0"}},{"ruleId":"D12","level":"warning","message":{"text":"Floating branch dependency: swiftdraw: Dependency \u0060swiftdraw\u0060 is resolved in Sidekick.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch \u0060latexswiftui\u0060 rather than a released version \u2014 the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"08d3fd5e298c13fb64bd08298f954afbc2b284de3cfcc94085d50798bdd9de3e"}},{"ruleId":"D20","level":"note","message":{"text":"No ADRs found: No ADRs found. No recognised ADR directory (\u0060docs/adr/\u0060, \u0060docs/decisions/\u0060, \u0060adr/\u0060, \u0060docs/rfcs/\u0060, an \u0060ADR0001/\u0060 folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (\u0060docs/adr/use-postgres.md\u0060, \u0060docs/adr/2024/0001-x.md\u0060); or a file anywhere whose name is ADR-shaped (\u00600001-use-postgres.md\u0060, \u0060adr-012-caching.md\u0060); or, when neither turned anything up, a document carrying the decision-record signature (an \u0022Architecture Decision Record\u0022 heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these \u2014 unnumbered files outside any recognised directory, without those headings \u2014 is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in \u0060docs/adr/\u0060."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"d2bea044ff79d7d275f5a91a6e2f548586178eaf480274c33960ad020c854631"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: LlamaServer.swift \u2192 Extension\u002BURL.swift, Function.swift, FunctionCallsView.swift, InferenceSettingsView.swift, ServerModelNameEditor.swift: \u0060Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift\u0060 changes together with 5 other files \u2014 \u0060Sidekick/Extensions/Extension\u002BURL.swift\u0060, \u0060Sidekick/Types/Conversation/Functions/Function.swift\u0060, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/FunctionCallsView.swift\u0060, \u0060Sidekick/Views/Settings/InferenceSettingsView.swift\u0060, \u0060Sidekick/Views/Settings/Model/ServerModelNameEditor.swift\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/LlamaServer.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b93eaad4b7120024f299f5ff340a0ee8cc63700c57bda5aac670851f1323dc40"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: ChatParameters.swift \u2194 Function.swift: \u0060Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift\u0060 and \u0060Sidekick/Types/Conversation/Functions/Function.swift\u0060 change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder \u2014 so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are \u006033e40a9d\u0060 feat: Improve tool calling reliability; \u0060609ef0b4\u0060 feat: Updated embedded docs; \u0060570a3aae\u0060 fix: Tool calling with local models \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"569d046567e29c790b202e4764e21320c9e734f06ffdeb878f146c644a38d77f"}},{"ruleId":"D35","level":"warning","message":{"text":"Change-coupling hub: Model.swift \u2192 ChatParameters.swift, Notifications.swift, FunctionCallsView.swift: \u0060Sidekick/Logic/Inference/Model.swift\u0060 changes together with 3 other files \u2014 \u0060Sidekick/Logic/Inference/llama.cpp/Types/ChatParameters.swift\u0060, \u0060Sidekick/Types/Notifications.swift\u0060, \u0060Sidekick/Views/Chat/Conversation/Messages/Message/FunctionCallsView.swift\u0060 \u2014 none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Inference/Model.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4049bfa2a0e3f29e0daaf588aeb0224cf93bec06802e2ed622df8273f602d6af"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: InferenceSettings.swift \u2194 ServerModelNameEditor.swift: \u0060Sidekick/Logic/Settings/InferenceSettings.swift\u0060 and \u0060Sidekick/Views/Settings/Model/ServerModelNameEditor.swift\u0060 change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder \u2014 so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are \u0060ac7735cc\u0060 feat: Allow selecting local worker model; \u00608754f892\u0060 fix: Fixed issue where \u0060/v1/models/\u0060 would fail to return models (at that commit the file was still \u0060Sidekick/Views/Settings/ServerModelNameEditor.swift\u0060); \u00609dd2a2e1\u0060 Added auto conversation title generation and allow configuring a \u0022Wor\u2026 (at that commit the file was still \u0060Sidekick/Views/Settings/ServerModelNameEditor.swift\u0060) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Logic/Settings/InferenceSettings.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c123633b367e35182b2a8acbde78793b0d9b5d1005c34d005da7cd1b5cbedd8d"}},{"ruleId":"AC3","level":"warning","message":{"text":"Page without a main landmark: No \u003Cmain\u003E (or role=\u0022main\u0022) means no \u0022skip to content\u0022 target and a weaker landmark map. Wrap the primary content in \u003Cmain\u003E."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Credits.html"},"region":{"startLine":4}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab9a34f8ab1ebe897dab56df56cb9ce3f7f3cf0f7ec5f2202823236489c2e62e"}},{"ruleId":"AC3","level":"warning","message":{"text":"Page without a main landmark: No \u003Cmain\u003E (or role=\u0022main\u0022) means no \u0022skip to content\u0022 target and a weaker landmark map. This document\u0027s body is only the mount point \u003Cdiv id=\u0022root\u0022\u003E, so there is no content here to wrap \u2014 render the \u003Cmain\u003E from the component mounted into it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.html"},"region":{"startLine":2}}}],"partialFingerprints":{"codehealthFindingId/v1":"83d4eb2754b406eaedd1e64888309f09921cdcdf1c54db000e7aa044da7c579a"}},{"ruleId":"AC3","level":"error","message":{"text":"Viewport restricts zoom: user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.html"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"61d78bdacf69ebfe8b30924820eab4f936275e832b7569eefef9f539d6906d95"}},{"ruleId":"AC3","level":"warning","message":{"text":"Page without a main landmark: No \u003Cmain\u003E (or role=\u0022main\u0022) means no \u0022skip to content\u0022 target and a weaker landmark map. Wrap the primary content in \u003Cmain\u003E."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/screenshot.html"},"region":{"startLine":2}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2bb454805987475028ba978a98ed85830bdf256c56d02c7fcc258701b9505a2"}},{"ruleId":"AC3","level":"error","message":{"text":"Viewport restricts zoom: user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/screenshot.html"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"78aa00d43b79a906abadefc1c86297aa6dffa9f826346b709de41a8ed4a1862d"}},{"ruleId":"AC3","level":"warning","message":{"text":"Page without a main landmark: No \u003Cmain\u003E (or role=\u0022main\u0022) means no \u0022skip to content\u0022 target and a weaker landmark map. Wrap the primary content in \u003Cmain\u003E."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/conversationExportTemplate.html"},"region":{"startLine":2}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8afa5be2d9e0f2e70aca2c2e188dc9a5939904b3c969b6e719497509a7fa701"}},{"ruleId":"AC6","level":"warning","message":{"text":"Animation without a prefers-reduced-motion guard: This stylesheet animates but never checks prefers-reduced-motion, so motion-sensitive users can\u0027t opt out. Wrap motion in @media (prefers-reduced-motion: no-preference)."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/conversationExportTemplate.html"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"016de600aee63ef1749d91054447baef694d55592288665a0d8b41f2f6bb9a85"}},{"ruleId":"AC6","level":"warning","message":{"text":"Low contrast colour pair in CSS (2.6:1): \u0060.assistant .icon\u0060 sets color: white on background-color: #a0a0a0 \u2014 2.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/conversationExportTemplate.html"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"b60bd614f4c55a6118d6a5379324af9284b2bd8e66d1f465aa1cc2d9bc84fdd0"}},{"ruleId":"AC7","level":"warning","message":{"text":"Accessibility enforcement below the top rung: No accessibility enforcement found \u2014 no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit\u0027s own accessibility assertion to the test suite (Flutter \u0060meetsGuideline\u0060, Espresso \u0060AccessibilityChecks\u0060, XCTest \u0060performAccessibilityAudit\u0060), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 6 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository\u0027s test and CI files \u2014 matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"d46019b86eff5ddad9db289e6802ac158899e980df54c34f67722442787ead62"}},{"ruleId":"M2","level":"note","message":{"text":"No ADRs: No Architecture Decision Records found \u2014 no conventional ADR directory, no numbered \u0060NNNN-title\u0060 documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"670b3d6e36a756d63097d0dfbf90afd5fc761308800b9354894a07c3f4e4aa14"}},{"ruleId":"P1","level":"warning","message":{"text":"No CI pipeline: No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, \u2026) \u2014 changes aren\u0027t gated by an automated build/test."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"44f01af96e50474fba2df84d95ddf4f7e1d34c29c307830b9efc9057daa6b670"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add CodeQL\u0027s Swift pack (Swift/Xcode) (or \u0060semgrep --config=auto\u0060, which runs on any language) \u2014 this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P6","level":"note","message":{"text":"No changelog: No CHANGELOG/HISTORY/RELEASES file \u2014 what shipped when isn\u0027t easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)"},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"dda5aa5aed8cbb292c3ef2b733bc138f614293ae6426c85e98bf31ef330d9415"}},{"ruleId":"S1","level":"warning","message":{"text":"Third-party script without Subresource Integrity: \u0060https://cdn.jsdelivr.net/npm/marked/marked.min.js\u0060 is executed by this page with no Subresource Integrity. Whoever can answer that request \u2014 the CDN, anyone who compromises it, anyone on the network path \u2014 runs arbitrary script in this page\u0027s origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time \u2014 the executed bytes can change with nobody touching this repository. 3 such include(s) across the repository\u0027s markup."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/conversationExportTemplate.html"},"region":{"startLine":8}}}],"partialFingerprints":{"codehealthFindingId/v1":"714ff4c2aacea84f473eddb17e9f88700602a4245e125c3a45247ffcd1036178"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060el.className \u0026\u0026 el.className.indexOf(\u0022language-\u0022) !== -1\u0060 appears character-identically in 2 files \u2014 Sidekick/Resources/ChatMarkdownWebView/chat.js, Sidekick/Resources/ChatMarkdownWebView/screenshot.js. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"75fe7e5e9721c45a1bcd2b4314c6410759f628ee6d4b6f39c687ff5e46632ac0"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060pre.closest \u0026\u0026 pre.closest(\u0022.sk-codeblock\u0022)\u0060 appears character-identically in 2 files \u2014 Sidekick/Resources/ChatMarkdownWebView/chat.js, Sidekick/Resources/ChatMarkdownWebView/screenshot.js. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sidekick/Resources/ChatMarkdownWebView/chat.js"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"96e052d57d9f2a916c7053b2cf3ed7c519a8ddac8b52525f6cf7af1dea647f41"}}],"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-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-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-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-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":0,"secretScannerRunsExcluded":0}}}]}