{"$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":"D5","name":"Coupling","shortDescription":{"text":"Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D5"},{"id":"D6","name":"Cohesion (LCOM4)","shortDescription":{"text":"Cohesion (LCOM4)"},"helpUri":"https://codehealth.canine.dev/dimensions/D6"},{"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"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"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":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D27","name":"Navigability","shortDescription":{"text":"Navigability"},"helpUri":"https://codehealth.canine.dev/dimensions/D27"},{"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"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"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"]},{"target":{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"],"owasp":"A05:2025"}},{"id":"D30","name":"Dependency Vulnerabilities","shortDescription":{"text":"Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D30","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"],"owasp":"A03:2025"}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"],"owasp":"A03:2025"}},{"id":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A02:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"],"owasp":"A02:2025"}},{"id":"D43","name":"Malicious Dependencies","shortDescription":{"text":"Malicious Dependencies"},"helpUri":"https://codehealth.canine.dev/dimensions/D43","relationships":[{"target":{"id":"CWE-506","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A08:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-506"],"owasp":"A08:2025"}},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AX2","name":"Stateful singletons","shortDescription":{"text":"Stateful singletons"},"helpUri":"https://codehealth.canine.dev/dimensions/AX2"},{"id":"AX3","name":"Project dependency cycles","shortDescription":{"text":"Project dependency cycles"},"helpUri":"https://codehealth.canine.dev/dimensions/AX3"},{"id":"AX4","name":"Dependency direction","shortDescription":{"text":"Dependency direction"},"helpUri":"https://codehealth.canine.dev/dimensions/AX4"},{"id":"AX8","name":"Test isolation","shortDescription":{"text":"Test isolation"},"helpUri":"https://codehealth.canine.dev/dimensions/AX8"},{"id":"AX9","name":"CQS / query purity","shortDescription":{"text":"CQS / query purity"},"helpUri":"https://codehealth.canine.dev/dimensions/AX9"},{"id":"AXB2","name":"Runtime readiness","shortDescription":{"text":"Runtime readiness"},"helpUri":"https://codehealth.canine.dev/dimensions/AXB2"},{"id":"ED5","name":"Idempotency","shortDescription":{"text":"Idempotency"},"helpUri":"https://codehealth.canine.dev/dimensions/ED5"},{"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":"P10","name":"Library API \u0026 versioning","shortDescription":{"text":"Library API \u0026 versioning"},"helpUri":"https://codehealth.canine.dev/dimensions/P10"},{"id":"P12","name":"CI test-gate honesty","shortDescription":{"text":"CI test-gate honesty"},"helpUri":"https://codehealth.canine.dev/dimensions/P12"},{"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":"P4","name":"Deployment \u0026 Rollback","shortDescription":{"text":"Deployment \u0026 Rollback"},"helpUri":"https://codehealth.canine.dev/dimensions/P4"},{"id":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"P7","name":"Outbound HTTP resilience","shortDescription":{"text":"Outbound HTTP resilience"},"helpUri":"https://codehealth.canine.dev/dimensions/P7"},{"id":"PF3","name":"Async \u0026 latency hygiene","shortDescription":{"text":"Async \u0026 latency hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/PF3"},{"id":"X10","name":"Duplicated predicate","shortDescription":{"text":"Duplicated predicate"},"helpUri":"https://codehealth.canine.dev/dimensions/X10"},{"id":"X13","name":"Undrained process stream","shortDescription":{"text":"Undrained process stream"},"helpUri":"https://codehealth.canine.dev/dimensions/X13"},{"id":"X14","name":"Bypassable address classification","shortDescription":{"text":"Bypassable address classification"},"helpUri":"https://codehealth.canine.dev/dimensions/X14"},{"id":"X15","name":"Unvalidated length from an untrusted reader","shortDescription":{"text":"Unvalidated length from an untrusted reader"},"helpUri":"https://codehealth.canine.dev/dimensions/X15"},{"id":"X17","name":"Uncapped recursion over a caller-supplied document","shortDescription":{"text":"Uncapped recursion over a caller-supplied document"},"helpUri":"https://codehealth.canine.dev/dimensions/X17"},{"id":"X19","name":"Unrestored process-global state","shortDescription":{"text":"Unrestored process-global state"},"helpUri":"https://codehealth.canine.dev/dimensions/X19"},{"id":"X20","name":"Mistyped argument guard","shortDescription":{"text":"Mistyped argument guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X20"},{"id":"X21","name":"Side-effecting pattern guard","shortDescription":{"text":"Side-effecting pattern guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X21"},{"id":"X22","name":"Contradicted release guard","shortDescription":{"text":"Contradicted release guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X22"},{"id":"X23","name":"Unguarded diagnostic materialisation","shortDescription":{"text":"Unguarded diagnostic materialisation"},"helpUri":"https://codehealth.canine.dev/dimensions/X23"},{"id":"X24","name":"Document value interpolated into markup unescaped","shortDescription":{"text":"Document value interpolated into markup unescaped"},"helpUri":"https://codehealth.canine.dev/dimensions/X24"},{"id":"X25","name":"Inert configuration knob","shortDescription":{"text":"Inert configuration knob"},"helpUri":"https://codehealth.canine.dev/dimensions/X25"},{"id":"X26","name":"Unsynchronised callback handoff","shortDescription":{"text":"Unsynchronised callback handoff"},"helpUri":"https://codehealth.canine.dev/dimensions/X26"},{"id":"X27","name":"Collection changed while being enumerated","shortDescription":{"text":"Collection changed while being enumerated"},"helpUri":"https://codehealth.canine.dev/dimensions/X27"},{"id":"X28","name":"Index access outside its own emptiness guard","shortDescription":{"text":"Index access outside its own emptiness guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X28"},{"id":"X3","name":"Exception handling","shortDescription":{"text":"Exception handling"},"helpUri":"https://codehealth.canine.dev/dimensions/X3"},{"id":"X30","name":"Support guard that admits what it rejects","shortDescription":{"text":"Support guard that admits what it rejects"},"helpUri":"https://codehealth.canine.dev/dimensions/X30"},{"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":"X7","name":"Silent fallback defaults","shortDescription":{"text":"Silent fallback defaults"},"helpUri":"https://codehealth.canine.dev/dimensions/X7"},{"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":"CLIArguments.parse (cyclomatic 168): CLIArguments.parse has cyclomatic complexity 168 (threshold 15). Of this number, 166 points are the body\u0027s own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass\u0027s cyclomatic complexity CONCENTRATES: Sources/CLI/CLIArguments.swift holds 2 of the 30 methods over the threshold \u2014 including the worst \u2014 and 185 of the 515 points over it (36%), 2.2\u00D7 the next-largest file (Sources/main.swift at 86). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"57af8f8b402067257385dfb6f78b38d18a6a22369ea7ca66c711d8d37ce39245"}},{"ruleId":"D1","level":"warning","message":{"text":"main.swift.top-level code (cyclomatic 101): main.swift.top-level code has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/main.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"b42ff811dcb22c63a13d1ae1222092c37dc13a67a6fcf99b686ac47d16b4e9c7"}},{"ruleId":"D1","level":"warning","message":{"text":"ResponsesRequestValidator.validate (cyclomatic 53): ResponsesRequestValidator.validate has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ResponsesModels.swift"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"caf6a00fab19a4536ab325c966053de98bdb9bd1a93b590fbe0d4105e7c16b15"}},{"ruleId":"D1","level":"warning","message":{"text":"ChatRequestValidator.validate (cyclomatic 49): ChatRequestValidator.validate has cyclomatic complexity 49 (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":"Sources/Core/ChatRequestValidator.swift"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a5165b1c9890e2421aaef6c0ffb750348b01f05824e2a6d3791ccf8b76ed0a2"}},{"ruleId":"D1","level":"warning","message":{"text":"Handlers.swift.streamingResponse (cyclomatic 48): Handlers.swift.streamingResponse has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"8552e699e1d88af29efc85bc89c53362b05b0d5a64801f3f3dd7e465bce78998"}},{"ruleId":"D1","level":"warning","message":{"text":"CLIArguments.validate (cyclomatic 47): CLIArguments.validate has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass\u0027s cyclomatic complexity CONCENTRATES: Sources/CLI/CLIArguments.swift holds 2 of the 30 methods over the threshold \u2014 including the worst \u2014 and 185 of the 515 points over it (36%), 2.2\u00D7 the next-largest file (Sources/main.swift at 86). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"a07c86cf96c1114facc8aa4a045234d1f38aeb6ebc47e5beb68870d84a6fbb80"}},{"ruleId":"D1","level":"warning","message":{"text":"CLI.swift.chat (cyclomatic 40): CLI.swift.chat has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a0d6df049705f485e7c9243041427f163f28f5e228faf712508ff7ea9fd8a8b"}},{"ruleId":"D1","level":"warning","message":{"text":"CLI.swift.countTokens (cyclomatic 35): CLI.swift.countTokens has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"620183177218889bed16fad7a03c8a71da8e0f6e53fb53a03cc237a2eb60ae79"}},{"ruleId":"D1","level":"warning","message":{"text":"JSONByteScanner.readString (cyclomatic 25): JSONByteScanner.readString has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/SchemaParser.swift"},"region":{"startLine":787}}}],"partialFingerprints":{"codehealthFindingId/v1":"4720195d70bcf283200a670d4f801c9dff78545ba796263a9b7b757bede82b92"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.swift.startServer (cyclomatic 25): Server.swift.startServer has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Server.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb50984279e4b775f74d3de00e326dc8aafeabe5403ea6dadae8bbae6e3973f9"}},{"ruleId":"D1","level":"warning","message":{"text":"JSONByteScanner.skipValue (cyclomatic 23): JSONByteScanner.skipValue 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":"Sources/Core/SchemaParser.swift"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0e2f76b2ca1dea2c87338cd2c6418a8eb06afac8e3c21e31204cf2a96607d1a"}},{"ruleId":"D1","level":"warning","message":{"text":"BufferedLineReader.readLine (cyclomatic 22): BufferedLineReader.readLine 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":"Sources/Core/BufferedLineReader.swift"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"24f410e16469d5b39eea01156ef605b5f8f387407129a954624a9fc0c3e99d2e"}},{"ruleId":"D1","level":"warning","message":{"text":"ToolCallHandler.extractCandidates (cyclomatic 21): ToolCallHandler.extractCandidates 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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"399b352cc03b3cfcddabc9391828a63c9c5c9bad2fba6b0ddcaeb1770273d2fe"}},{"ruleId":"D1","level":"warning","message":{"text":"ToolCallHandler.repairUnclosedContainers (cyclomatic 21): ToolCallHandler.repairUnclosedContainers 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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"79de23293d491f53de7aa93ebfb34b6ecab59c7ae318ee21bb7b4ae73f022239"}},{"ruleId":"D1","level":"warning","message":{"text":"TokenCounter.fallbackCount (cyclomatic 21): TokenCounter.fallbackCount 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":"Sources/Engine/TokenCounter.swift"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbf860c7dd7b240362d58a9226858167ef0fb946c31964f2bc0aa2dbd74c7b2f"}},{"ruleId":"D1","level":"warning","message":{"text":"Handlers.swift.mcpAutoExecuteResponse (cyclomatic 21): Handlers.swift.mcpAutoExecuteResponse 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":"Sources/Handlers.swift"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"defa2b9f277bbce87557dc5b40f8786ca66d6b375d8fff2736ca70ab923176c8"}},{"ruleId":"D1","level":"warning","message":{"text":"Handlers.swift.handleChatCompletion (cyclomatic 20): Handlers.swift.handleChatCompletion 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":"Sources/Handlers.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bcb5b0e2a776cbf677fcdce6488b564e11017ff8cf2874c8467060c4ff0c5dc"}},{"ruleId":"D1","level":"warning","message":{"text":"BatchRecordParser.parse (cyclomatic 19): BatchRecordParser.parse has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/Batch.swift"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"62f5ceb06cb2277915a579f7767ee00ec1c06acfafde19d88993054fde2f7e7a"}},{"ruleId":"D1","level":"warning","message":{"text":"JSONByteScanner.collectKeyOrders (cyclomatic 19): JSONByteScanner.collectKeyOrders has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/SchemaParser.swift"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b9d72975c4199e8ab90e9dd96fa9ee443cad978bc861f5a3dd6645c62395fc6"}},{"ruleId":"D1","level":"warning","message":{"text":"CLI.swift.performUpdate (cyclomatic 19): CLI.swift.performUpdate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":785}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dcb3e2a01b8c9a400d7b87279c0af7412bf5796863626d09e2aa0ca2fc2da5b"}},{"ruleId":"D1","level":"warning","message":{"text":"ResponsesHandlers.swift.responsesStreamingResponse (cyclomatic 19): ResponsesHandlers.swift.responsesStreamingResponse has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/ResponsesHandlers.swift"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ad55cdef87cb8d88f4675b4d01b41a0b592e7767c8f9d416e80ca89a4cf13f9"}},{"ruleId":"D1","level":"warning","message":{"text":"MCPProtocol.validateToolArguments (cyclomatic 18): MCPProtocol.validateToolArguments has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/MCPProtocol.swift"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"c10091fe1a9617595073390ee8d282aed9dafdcf167351a4c00c1c18cc83dd3a"}},{"ruleId":"D1","level":"warning","message":{"text":"MCPConnection.send (cyclomatic 17): MCPConnection.send 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":"Sources/MCPClient.swift"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"82f8e86f73e803eba5da6001acfd5bbf949c58474f0a4fc29828f06e89d68df9"}},{"ruleId":"D1","level":"warning","message":{"text":"BatchRunner.swift.runBatch (cyclomatic 17): BatchRunner.swift.runBatch has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/BatchRunner.swift"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"52e8ce62b50da571ea812a2335a6d04ea6f6f391900a4476d21a91bf6498956c"}},{"ruleId":"D1","level":"warning","message":{"text":"server.execute (cyclomatic 17): server.execute has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"mcp/calculator/server.py"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"63c8a46d36d97a6fbb3e52e87cfa8cee7adfcfca532dd477c67b9d5b6d4bfa4d"}},{"ruleId":"D1","level":"warning","message":{"text":"ImageInput.parseDataURL (cyclomatic 16): ImageInput.parseDataURL has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ImageInput.swift"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"364430e5b978b26dafee9bdf8184a64abe1af85a350412c5adb1742436a99d6e"}},{"ruleId":"D1","level":"warning","message":{"text":"ToolCallHandler.parseToolCallJSON (cyclomatic 16): ToolCallHandler.parseToolCallJSON has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec763d6cdef13baa4ae7b207787b1edaf8593d62a23574a9a2904b9ab76c67e4"}},{"ruleId":"D1","level":"warning","message":{"text":"RemoteMCPConnection.post (cyclomatic 16): RemoteMCPConnection.post has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/MCPClient.swift"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fa529f61b2f15967388a80f1a36f2538108a93f68a6fe14e5f83351d99638e4"}},{"ruleId":"D1","level":"warning","message":{"text":"Handlers.swift.nonStreamingResponse (cyclomatic 16): Handlers.swift.nonStreamingResponse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"010b0f354ae119ad446c9d0e850227a881dafd3aba4b36d733b3f49f94f19b27"}},{"ruleId":"D1","level":"warning","message":{"text":"ResponsesHandlers.swift.responsesNonStreamingResponse (cyclomatic 16): ResponsesHandlers.swift.responsesNonStreamingResponse has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/ResponsesHandlers.swift"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e13c6c9bbec192e97b06160ced004971a41c4286d08bb73ffd0b331e26c10d3"}},{"ruleId":"D2","level":"warning","message":{"text":"CLIArguments.parse (cognitive 243): CLIArguments.parse has cognitive complexity 243 (threshold 15). Drivers by points: if/else 71 (158 pts), error handling 11 (37 pts), boolean chains 34, loops 4 (8 pts), match/switch 2 (5 pts), ternaries 1 (nesting depth added 120). Of this number, 241 points are the body\u0027s own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0a6968c7b1f7e0f39ef4494cdf93beb3c6452f16eb99ee057d29057305cf30f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.swift.top-level code (cognitive 172): main.swift.top-level code has cognitive complexity 172 (threshold 15). Drivers by points: if/else 54 (107 pts), boolean chains 17, error handling 8 (17 pts), loops 6 (13 pts), ternaries 5 (12 pts), match/switch 4 (6 pts) (nesting depth added 78). 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":"Sources/main.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc6d0e561b9229e564b082c877d92d3595b30f3243ead8c32180a5e803116c5f"}},{"ruleId":"D2","level":"warning","message":{"text":"Handlers.swift.streamingResponse (cognitive 101): Handlers.swift.streamingResponse has cognitive complexity 101 (threshold 15). Drivers by points: if/else 27 (69 pts), ternaries 8 (13 pts), boolean chains 9, loops 2 (5 pts), error handling 3, match/switch 1 (2 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"744f8df97db6fef2fdf9380fd6570b848c463ebcec7ecb15a77bf573bf751f42"}},{"ruleId":"D2","level":"warning","message":{"text":"ResponsesRequestValidator.validate (cognitive 87): ResponsesRequestValidator.validate has cognitive complexity 87 (threshold 15). Drivers by points: if/else 29 (59 pts), boolean chains 14, loops 4 (11 pts), match/switch 2 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ResponsesModels.swift"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"83e6753cf7038fe14161d9269311aaede25d3286d5d3b51d25a6b4b406551fa6"}},{"ruleId":"D2","level":"warning","message":{"text":"CLI.swift.chat (cognitive 83): CLI.swift.chat has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (57 pts), ternaries 3 (9 pts), boolean chains 7, error handling 2 (6 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd6fac45ce5c8383c0c7f9b2f55b249533e3d5195d42426b906c3cce01a23227"}},{"ruleId":"D2","level":"warning","message":{"text":"CLIArguments.validate (cognitive 62): CLIArguments.validate has cognitive complexity 62 (threshold 15). Drivers by points: if/else 35 (51 pts), boolean chains 11 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3145c51f83498fd7ccaf386d578574a9deb6dc6584fc935cb5b4fb81e3ed8fd"}},{"ruleId":"D2","level":"warning","message":{"text":"CLI.swift.countTokens (cognitive 53): CLI.swift.countTokens has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 9, loops 2 (4 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"86e3584cdf3026c7ab9028c7c1f0c36ecdcad7571409792f5792db7e34724c36"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatRequestValidator.validate (cognitive 51): ChatRequestValidator.validate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (29 pts), boolean chains 20, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ChatRequestValidator.swift"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"b741a12a1ffa9890ffca36fcd7ba123a907fd4db8f8753215a60271a0a0b56f3"}},{"ruleId":"D2","level":"warning","message":{"text":"TokenCounter.fallbackCount (cognitive 50): TokenCounter.fallbackCount has cognitive complexity 50 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 8 (23 pts), match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/TokenCounter.swift"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c268e7d7b093a946d217a910b3941c2f87fef5c769aec99e16d3e867ef972da"}},{"ruleId":"D2","level":"warning","message":{"text":"JSONByteScanner.readString (cognitive 47): JSONByteScanner.readString has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (39 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/SchemaParser.swift"},"region":{"startLine":787}}}],"partialFingerprints":{"codehealthFindingId/v1":"871a37bebeb4ea7ebb27bb959848994f8f890f729e7e07908a2a7c1913697520"}},{"ruleId":"D2","level":"warning","message":{"text":"Handlers.swift.mcpAutoExecuteResponse (cognitive 44): Handlers.swift.mcpAutoExecuteResponse has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (26 pts), ternaries 4 (12 pts), loops 1 (3 pts), error handling 2, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3a2d6dfc91c8b5dbf4b80da7370ebe15eee9505182cc79ea1232f59f5a097ba"}},{"ruleId":"D2","level":"warning","message":{"text":"JSONByteScanner.skipValue (cognitive 39): JSONByteScanner.skipValue has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 7, loops 3 (6 pts), match/switch 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/SchemaParser.swift"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"acf4115487568d6b077fffdd6fe665161f2a1127c89e247d18e67db4e43915ef"}},{"ruleId":"D2","level":"warning","message":{"text":"BufferedLineReader.readLine (cognitive 38): BufferedLineReader.readLine has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/BufferedLineReader.swift"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"56cc6678a5a7f9491849ff912d0450e38e595e5324ea80232f2d8862b5f9dd49"}},{"ruleId":"D2","level":"warning","message":{"text":"ResponsesHandlers.swift.responsesNonStreamingResponse (cognitive 37): ResponsesHandlers.swift.responsesNonStreamingResponse has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), ternaries 2 (5 pts), match/switch 1 (3 pts), error handling 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":"Sources/ResponsesHandlers.swift"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"1abd09008e7fa765b91bfd81ab986bccfe0b66bfadff8cd936b1ffd373a95c7a"}},{"ruleId":"D2","level":"warning","message":{"text":"JSONByteScanner.collectKeyOrders (cognitive 36): JSONByteScanner.collectKeyOrders has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/SchemaParser.swift"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"644b3767073f86bcc0d64c2832b736a8a2082cd2d17c39f5554f18389e3b27cb"}},{"ruleId":"D2","level":"warning","message":{"text":"ResponsesHandlers.swift.responsesStreamingResponse (cognitive 35): ResponsesHandlers.swift.responsesStreamingResponse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 8 (12 pts), error handling 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/ResponsesHandlers.swift"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ce8ce24fb26b398b28e850869903b5d0be01347efa235d29dce4ce0e02c139d"}},{"ruleId":"D2","level":"warning","message":{"text":"ToolCallHandler.extractCandidates (cognitive 33): ToolCallHandler.extractCandidates has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"a75a63b05b23537a9d8cbe97114ca9860dfeb4a08c66eec6d299873fb72338be"}},{"ruleId":"D2","level":"warning","message":{"text":"MCPConnection.send (cognitive 30): MCPConnection.send has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/MCPClient.swift"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"0237a15377e7be749fe37fe09ce06ef57477da40ced3883c90031b5db7a623eb"}},{"ruleId":"D2","level":"warning","message":{"text":"ToolExchangeGrouping.scan (cognitive 29): ToolExchangeGrouping.scan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). Of this number, 28 points are the body\u0027s own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolExchangeGrouping.swift"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"57ed9eb379b7cb8cb4e3ebb87d0db4b6a3e8f8432d611a9d19fd6e213fc3ff48"}},{"ruleId":"D2","level":"warning","message":{"text":"Session.swift.collectStream (cognitive 29): Session.swift.collectStream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/Session.swift"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"170975c4a7b65016e7bdb2b58643c877d7375ae938eecda5f06080b749b938e4"}},{"ruleId":"D2","level":"warning","message":{"text":"ToolCallHandler.repairUnclosedContainers (cognitive 26): ToolCallHandler.repairUnclosedContainers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3b39e20a061854eca5f38ec1967af8f6c2b2729db8e00a72748c5a132297613"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.swift.startServer (cognitive 26): Server.swift.startServer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 8 (9 pts), error handling 4, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Server.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d7d890b27b0fc61dba7982fcbbe129bc7fb25b67bd869dca8696a44f0301f15"}},{"ruleId":"D2","level":"warning","message":{"text":"ResponsesMapper.messages (cognitive 24): ResponsesMapper.messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (6 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ResponsesModels.swift"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"e07ebfc07e5ebbca691598f2983519e78c9601b1c94cfe8610b92a6051773e9c"}},{"ruleId":"D2","level":"warning","message":{"text":"VisionSupport.swift.promptPieces (cognitive 24): VisionSupport.swift.promptPieces has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). 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":"Sources/Engine/VisionSupport.swift"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"684eb9d69a69321051085c895ffd559e8fa6a741f5f9d95d35f4ec9a0e4bb3d7"}},{"ruleId":"D2","level":"warning","message":{"text":"Handlers.swift.handleChatCompletion (cognitive 24): Handlers.swift.handleChatCompletion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 4 (5 pts), boolean chains 2, ternaries 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"f44833410b681cc5d8534fafa8eefdbb9eef1169634e3fa180c8b6d01fba67a0"}},{"ruleId":"D2","level":"warning","message":{"text":"Handlers.swift.structuredStreamingResponse (cognitive 24): Handlers.swift.structuredStreamingResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4, error handling 2, loops 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":"Sources/Handlers.swift"},"region":{"startLine":1242}}}],"partialFingerprints":{"codehealthFindingId/v1":"56666c7ce6bee0a7d1e435299bd47167fb325a4223b2cc91a3c0a091603d0919"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchRunner.swift.runBatch (cognitive 23): BatchRunner.swift.runBatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (5 pts), error handling 1 (2 pts), loops 2, ternaries 1 (nesting depth added 9). Of this number, 15 points are the body\u0027s own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/BatchRunner.swift"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1f3aa490de57a0a48e0983658fb97f657cf62dbafd7dd97eea1e7e4dc5faef6"}},{"ruleId":"D2","level":"warning","message":{"text":"Handlers.swift.nonStreamingResponse (cognitive 23): Handlers.swift.nonStreamingResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 4 (6 pts), error handling 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"faae232701301f26a49e69a4acd4040c1d58b78e48ec5d15cd19b540c7fdf441"}},{"ruleId":"D2","level":"warning","message":{"text":"RemoteMCPConnection.post (cognitive 22): RemoteMCPConnection.post has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/MCPClient.swift"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"d42c59d0ee34949ed6028efc39acb1df845859b34db580a52f539a4b7fd18e5a"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchRunner.swift.generateBatchRecord (cognitive 22): BatchRunner.swift.generateBatchRecord has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/BatchRunner.swift"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"0faa270b17071519d235c7887630417a727af734d1e69321e842b7152e50daa9"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchRecordParser.parse (cognitive 21): BatchRecordParser.parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 4, boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"Sources/CLI/Batch.swift"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cc45e0a49d91a9f6eca7d899c9383a5724b0560523f02a7dc15203986eedbd0"}},{"ruleId":"D2","level":"warning","message":{"text":"OnDeviceEngine.send (cognitive 21): OnDeviceEngine.send has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/OnDeviceEngine.swift"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c5f8887e7d66cb7684b680f84e3139b444e96e06082d8807f51db865a8e60a3"}},{"ruleId":"D2","level":"warning","message":{"text":"ToolCallHandler.extractFirstBalancedObject (cognitive 20): ToolCallHandler.extractFirstBalancedObject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"df5335752051fa263c4a331600e19e91dd056c94ba4e0459da088b9e6a5657f0"}},{"ruleId":"D2","level":"warning","message":{"text":"ToolCallHandler.parseToolCallJSON (cognitive 20): ToolCallHandler.parseToolCallJSON has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"58b8c8109f650e419395a340a89ac29408edcd12b93ce3f66e19a3d437ca9ab5"}},{"ruleId":"D2","level":"warning","message":{"text":"MCPProtocol.classifyIncoming (cognitive 19): MCPProtocol.classifyIncoming has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/MCPProtocol.swift"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f569d849d4f63beb773ad414e3102beaec0ec79823db7c0f4c4157e47c82e1f"}},{"ruleId":"D2","level":"warning","message":{"text":"CLI.swift.performUpdate (cognitive 19): CLI.swift.performUpdate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), match/switch 1 (nesting depth added 1). 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":"Sources/CLI.swift"},"region":{"startLine":785}}}],"partialFingerprints":{"codehealthFindingId/v1":"27cb6cf278ff4489a244b20acb9e6bcab1869280a6f58159e497389955223806"}},{"ruleId":"D2","level":"warning","message":{"text":"MCPProtocol.validateToolArguments (cognitive 18): MCPProtocol.validateToolArguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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":"Sources/Core/MCPProtocol.swift"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"821d88570952f7a1157a2954463cc85f3de169a2fd0137d8ed23a4844595939c"}},{"ruleId":"D2","level":"warning","message":{"text":"StructuredJSON.writePrefix (cognitive 18): StructuredJSON.writePrefix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/StructuredJSONStream.swift"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ad4b88f081ea9133f36ca9444cc1e43f2b1984150b884487cdbc379f6a85a95"}},{"ruleId":"D2","level":"warning","message":{"text":"ContextManager.historyEntry (cognitive 18): ContextManager.historyEntry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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":"Sources/Engine/ContextManager.swift"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cfa4170d9af069d92e993e4f25ea4a6cac941057a7ebfc63646e8525202d2b6"}},{"ruleId":"D2","level":"warning","message":{"text":"MCPManager.init (cognitive 18): MCPManager.init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/MCPClient.swift"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce8400117fa060f325a1e163debf80e2f30d7df70e7c6229b13ea42d059c5b23"}},{"ruleId":"D2","level":"warning","message":{"text":"CLI.swift.emitOneShotResult (cognitive 17): CLI.swift.emitOneShotResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"0daeb0af49b7fc9ca2f371517a1be63a69cb9790c415a6549b915cb6e2cb5515"}},{"ruleId":"D2","level":"warning","message":{"text":"ChatRequestValidator.validateImageParts (cognitive 16): ChatRequestValidator.validateImageParts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ChatRequestValidator.swift"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"780ea235becf9386bae39882f6e0a57c5f94a3abb0a5656561d1ce8d879f7955"}},{"ruleId":"D2","level":"warning","message":{"text":"Session.swift.executeMCPTools (cognitive 16): Session.swift.executeMCPTools has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Session.swift"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"a82aab8082cba50fc754360fe0ec20f915f9fe7c9893ef618111fb2f31899bf9"}},{"ruleId":"D2","level":"warning","message":{"text":"server.get_nums (cognitive 16): server.get_nums has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 2 (4 pts), error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"mcp/calculator/server.py"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"370a377fb6aba0a8ea3e7f10aee770f6b65bc0bdacff66aa4f530c7e83909595"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: main.swift.top-level code: FunctionTooLong \u2014 top-level code runs 315 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 215 over it, 3.15\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":"Sources/main.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"4de3b1fdb3ce1b23a7cf0c0e1cd443cabeddeca5e91de73ba64ae8e53de6d326"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Sources/Handlers.swift: FileTooLong \u2014 1133 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 633 over it, 2.27\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":"Sources/Handlers.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8a3ebf799b32aa7e69232eab4a22fd2e06de37428d87ffa43829671166441e1"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: Server.swift.startServer: FunctionTooLong \u2014 startServer runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89\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":"Sources/Server.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfd45a3eb299d5751ad232c9215947cfd1220a7b5983c3b5e66a0110a12055d8"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: ResponsesHandlers.swift.responsesStreamingResponse: FunctionTooLong \u2014 responsesStreamingResponse runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67\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":"Sources/ResponsesHandlers.swift"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"c35156fe56d50df6b31545ffc8f62f473a3840c974c5e200b6dbc4d95eaa1866"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: InputTokensHandler.swift.handleInputTokens: FunctionTooLong \u2014 handleInputTokens runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33\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":"Sources/InputTokensHandler.swift"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a19fde1573b408c4a4733a0b30e6298adc720ee93b12423e25a0924fd68aca7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: CLI/CLIArguments.swift: FileTooLong \u2014 605 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 105 over it, 1.21\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":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f74be93bd7dddaa9d61538ac41bfbaf4e0050aee880d79baeb5fc2d5caaab3d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Sources/CLI.swift: FileTooLong \u2014 591 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 91 over it, 1.18\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":"Sources/CLI.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a85aa90af29ebd47237346b281971a4fab58d87f01eabf93eb2775dc9d2622de"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: CLI.swift.chat: FunctionTooLong \u2014 chat runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15\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":"Sources/CLI.swift"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"8691f365dc0b9dfe919d3423503f96b9e1c45c831a31f39415e3c62c4c76fd2e"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: ResponsesHandlers.swift.handleResponses: FunctionTooLong \u2014 handleResponses runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13\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":"Sources/ResponsesHandlers.swift"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1b5dea104c06abc0a3dd79687fe99532d420da7c3957d388939cdb4871e971f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Sources/Benchmark.swift: FileTooLong \u2014 546 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 46 over it, 1.09\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":"Sources/Benchmark.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bd6243254d2d2ab37119fb5cbcdd072c7c3c0c7e1b46c6646b9513c03ea3b1e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Core/SchemaParser.swift: FileTooLong \u2014 532 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 32 over it, 1.06\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":"Sources/Core/SchemaParser.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"700d95a02b8d435d661f19700260abe401de1e483d110248357d797153657ced"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: CLI.swift.countTokens: FunctionTooLong \u2014 countTokens runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04\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":"Sources/CLI.swift"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"388c5007124e0484422be3ce84202b3f64cb22ebcdbe0fa97568bf717945cef0"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: ResponsesHandlers.swift.responsesNonStreamingResponse: FunctionTooLong \u2014 responsesNonStreamingResponse runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02\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":"Sources/ResponsesHandlers.swift"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"733a56fab3d57230679690e3fae0131091fc1d96b089c6eef3bc50885ae07abc"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (3 members, 12 shared lines): Sources/Handlers.swift:39-322 | Sources/InputTokensHandler.swift:19-178 | Sources/ResponsesHandlers.swift:74-222 \u2014 These 3 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members\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 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c0d8defd56635f0c98079344682acf481f187bc06b8080a3741a34e55c8eb7e"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (119 shared lines): Sources/Handlers.swift:685-1149 | Sources/Handlers.swift:1242-1434 \u2014 These two members are variants of one another: 119 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdb91a09574ff24db56320fbf537336f7d100a5146a0395025fc4f3df1f55324"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): Sources/Core/ToolCallHandler.swift:212-243 | Sources/Core/ToolCallHandler.swift:283-313 | Sources/Core/ToolCallHandler.swift:317-390 | Sources/Core/ToolCallHandler.swift:474-507 | Sources/Core/ToolCallHandler.swift:512-540 \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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c557305ab12088bddf5a801bba92e0ee34004117cf177b3ab8a7e3ff2ebc33"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (36 corresponding lines): Sources/Core/OpenAIModels.swift:114-151 | Sources/Core/OpenAIModels.swift:155-190 \u2014 These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"8611c76df4065f66709e470d90745c34c3868c03cd8ebe3e3435258f6940147b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (43 corresponding lines): Sources/Benchmark.swift:150-192 | Sources/Benchmark.swift:194-236 \u2014 These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Benchmark.swift"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a73a66d14e283db60fa2ef1324cacc77460cb24cbc461fd9cacb82db2ae9df5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (28 corresponding lines): mcp/calculator/server.py:137-173 | mcp/http-test-server/server.py:108-135 \u2014 These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"mcp/calculator/server.py"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fc6716579f8a83918045d0de3dfd7962cf0992d80240abecb86ee4eddfe4a11"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (24 corresponding lines): Sources/Benchmark.swift:289-312 | Sources/Benchmark.swift:314-338 \u2014 These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Benchmark.swift"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"485b482193f0c0fa649eacdc2eb51703046bc154494ed943db35b029736eec06"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): Sources/Core/JSONFenceStripper.swift:21-47 | Sources/Core/JSONFenceStripper.swift:54-66 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Core/JSONFenceStripper.swift"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"99e620f720d89f397a374d9df2f867bd9a0044a4f9f770e9ae5fd193745649f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): Sources/Core/ToolExchangeGrouping.swift:189-201 | Sources/Core/ToolExchangeGrouping.swift:205-218 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Core/ToolExchangeGrouping.swift"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"85ffa2f1bf04babde2c3a442f0887b79fc84057ed7de518b52b310775875e199"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 10\u002B corresponding lines): Sources/Engine/Session.swift:351-360 | Sources/Engine/Session.swift:364-373 | Sources/Engine/Session.swift:379-391 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/Session.swift"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"13d1fd94c257b6397e1549a174624f9137fbedb034443339087fdc04f8517a7f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 10\u002B corresponding lines): Sources/ResponsesWire.swift:275-286 | Sources/ResponsesWire.swift:302-311 | Sources/ResponsesWire.swift:327-336 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/ResponsesWire.swift"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"9004d141840bf02b23d3aad9b8050031ee2a012751e16576751a3a940cc57f8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): Sources/Core/OpenAIModels.swift:242-262 | Sources/Models.swift:124-136 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e3035a80617215249aff96b53162f969b12cdd303d6c1222b0a579f9ef3039"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): Sources/Benchmark.swift:723-737 | Sources/Benchmark.swift:739-753 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Benchmark.swift"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"62252837b7584a026123b8c2652841fa23b59aa5af6a5930462d502e5f55a837"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): Sources/Benchmark.swift:238-262 | Sources/Benchmark.swift:361-377 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Benchmark.swift"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"77d5716ff935ed9a9bed0772678d95f9448d629ed9ceea7a36dd097d40835bad"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 16\u002B corresponding lines): Sources/SSE.swift:35-50 | Sources/SSE.swift:53-68 | Sources/SSE.swift:71-86 | Sources/SSE.swift:89-104 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/SSE.swift"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cd84b173f1300bf6957f40a4440b80f6c4c3fe62bb4257cc3400e214c5c6401"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): Sources/Engine/TokenCounter.swift:42-56 | Sources/Engine/TokenCounter.swift:190-204 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Engine/TokenCounter.swift"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"5008f29a29f4bbe63dcf4146c49dd9d53f0587b9ffbc1671a8cc4bac4aa14bed"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): Sources/ResponsesWire.swift:135-142 | Sources/ResponsesWire.swift:346-353 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/ResponsesWire.swift"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9eb1abfd1a45465be02df6c7cc593e4dfefae9cb3fc962f05b51f3e498d3c62"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (7 corresponding lines): Sources/Models.swift:88-94 | Sources/Models.swift:147-153 \u2014 These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Models.swift"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f94c1060f2f10758c92f4dd7272695c571e5cebdc182fda8401db2e25c40b55"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): Sources/Engine/Session.swift:115-127 | Sources/Engine/Session.swift:132-142 \u2014 These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Engine/Session.swift"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"87c4cb119bddfef641e934719eff17831fb053040f76e8a27bd9c389823cf3fc"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (4 corresponding lines): Sources/CLI/Batch.swift:228-231 | Sources/CLI/Batch.swift:238-242 \u2014 These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/CLI/Batch.swift"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"812a217f8387fcd38d381e8f2a7e93f82b81b4e5d046b7db9664d1e181dfa5f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): Sources/CLI/Batch.swift:283-290 | Sources/JSON.swift:14-23 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/CLI/Batch.swift"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"7becbfb7b83f711e276e1b4852a059166054468c518143341a07c60486ef4b9c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): Sources/Core/ToolCallHandler.swift:172-179 | Sources/Core/ToolCallHandler.swift:419-429 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"36ca6565b5292cb0e07673033274501e2122edf9ce627acd3337517fd9d91999"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): mcp/calculator/server.py:121-133 | mcp/http-test-server/server.py:93-100 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"mcp/calculator/server.py"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"c53fd96180e624401d221c63395e153acd6140ecc7000dc784e34226ed0bd634"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (64 lines \u00D7 2): Sources/Handlers.swift:1086-1149 | Sources/Handlers.swift:1371-1434 \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 \u0060Sources/Handlers.swift:1086\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. The matched lines also transfer control out of the body holding them, 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":"Sources/Handlers.swift"},"region":{"startLine":1086}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c5a84459e0cb70ea68e47f733186e3dbda2f0e208748bff4a50ba90f9a8bd96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26\u201327 lines \u00D7 2): Sources/Handlers.swift:701-727 | Sources/Handlers.swift:1257-1282 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sources/Handlers.swift:701\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":"Sources/Handlers.swift"},"region":{"startLine":701}}}],"partialFingerprints":{"codehealthFindingId/v1":"602d3977e252f7bb4dd6f96eafe546899de4c1f1648502f351ac19e2f425c486"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (33 lines \u00D7 3): Sources/Handlers.swift:1112-1144 | Sources/Handlers.swift:1397-1429 | Sources/ResponsesHandlers.swift:543-575 \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 \u0060Sources/Handlers.swift:1112\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. The matched lines also transfer control out of the body holding them, 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":"Sources/Handlers.swift"},"region":{"startLine":1112}}}],"partialFingerprints":{"codehealthFindingId/v1":"05f482780ffb6e434abdcf61979eb9d8965a600c1dae8ced337fc592bfc285b8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19\u201320 lines \u00D7 3): Sources/Handlers.swift:514-532 | Sources/Handlers.swift:658-677 | Sources/Handlers.swift:1212-1230 \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 \u0060Sources/Handlers.swift:514\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":514}}}],"partialFingerprints":{"codehealthFindingId/v1":"cab3cd6cd4c017c9d95e0aa5f8e4a2b86a19054eeafe813b42e40131fd902036"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201319 lines \u00D7 3): Sources/Handlers.swift:40-58 | Sources/InputTokensHandler.swift:20-31 | Sources/ResponsesHandlers.swift:75-87 \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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sources/Handlers.swift:40\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f62f560fe02a21f0a4ab3d90b5279b5a3402d2be3b59c5e53f04beeac7f8327"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201318 lines \u00D7 2): Sources/Core/OpenAIModels.swift:123-140 | Sources/Core/OpenAIModels.swift:163-179 \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 \u0060Sources/Core/OpenAIModels.swift:123\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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1c3122f54ca2cc066e89e194c152e0bd5fbe511aa2950b29fadf5ba907e91fc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201317 lines \u00D7 3): Sources/Core/ToolCallHandler.swift:220-232 | Sources/Core/ToolCallHandler.swift:289-301 | Sources/Core/ToolCallHandler.swift:360-376 \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 \u0060Sources/Core/ToolCallHandler.swift:220\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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bbc8d539bd95d170d8414d7c78a69c2f69c2eb98e2e76e6b08d0ec60bbd4e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): Sources/Benchmark.swift:176-192 | Sources/Benchmark.swift:220-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 \u0060Sources/Benchmark.swift:176\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. The matched lines also transfer control out of the body holding them, 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":"Sources/Benchmark.swift"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2cc05e35401b03558c6739043a0db1d8a77f0a710f5d6804c7e9d1abbc93a95"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): Sources/Handlers.swift:601-616 | Sources/Handlers.swift:1184-1199 \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 \u0060Sources/Handlers.swift:601\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. The matched lines also transfer control out of the body holding them, 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":"Sources/Handlers.swift"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"1691f13a5bb9512753f6e96cca6b6d8f2641cbf1453b24fbe38e597acba6131e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201315 lines \u00D7 2): Sources/Handlers.swift:173-187 | Sources/ResponsesHandlers.swift:151-162 \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 \u0060Sources/Handlers.swift:173\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":"Sources/Handlers.swift"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb8dd6236403be81a930823f8aa738be3a56b92f835b9718bbb537cf86f6fad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201315 lines \u00D7 2): Sources/Handlers.swift:1029-1043 | Sources/Handlers.swift:1335-1344 \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 \u0060Sources/Handlers.swift:1029\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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":1029}}}],"partialFingerprints":{"codehealthFindingId/v1":"e79f040cb6f7d6d80f6d496e29c37817f9a98574a93d1ab62bf09b56d1c9ad01"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201314 lines \u00D7 4): Sources/Core/ToolCallHandler.swift:222-231 | Sources/Core/ToolCallHandler.swift:291-300 | Sources/Core/ToolCallHandler.swift:362-375 | Sources/Core/ToolCallHandler.swift:521-530 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \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 \u0060Sources/Core/ToolCallHandler.swift:222\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, \u0060Sources/Core/ToolCallHandler.swift:377\u0060 calls \u0060String\u0060 and \u0060Sources/Core/ToolCallHandler.swift:531\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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4004882857bcbbc8dbf58d86c3b63ef617fcb188ea060bc47d9f3df289a9f4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): Sources/Handlers.swift:696-708 | Sources/Handlers.swift:1252-1264 | Sources/ResponsesHandlers.swift:383-395 \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 \u0060Sources/Handlers.swift:696\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, \u0060Sources/Handlers.swift:709\u0060 calls \u0060reserveCapacity\u0060 and \u0060Sources/ResponsesHandlers.swift:396\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":"Sources/Handlers.swift"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"422177e9fdf79c5614a65d5b05129771759afd10afc1ebd582a3a3420f32e8c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201313 lines \u00D7 2): Sources/Handlers.swift:68-80 | Sources/ResponsesHandlers.swift:96-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 \u0060Sources/Handlers.swift:68\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":"Sources/Handlers.swift"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba30aef551b2306a66b3286ab1ace733f0c5be0328dbecf83adba06ec1b3500e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 2): Sources/InputTokensHandler.swift:84-95 | Sources/ResponsesHandlers.swift:146-158 \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 \u0060Sources/InputTokensHandler.swift:84\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":"Sources/InputTokensHandler.swift"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9afdfcacd272e0d394664fe77d35b4d9cb1bded67b102ecd9375151861f69af"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201312 lines \u00D7 4): Sources/Handlers.swift:959-966 | Sources/Handlers.swift:1039-1049 | Sources/Handlers.swift:1080-1091 | Sources/Handlers.swift:1343-1350 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \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 \u0060Sources/Handlers.swift:959\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":"Sources/Handlers.swift"},"region":{"startLine":959}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d6d9a002b7dd796911a8c4b570381fa7579558433718d4839b45527f8b157a7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): Sources/Core/OpenAIModels.swift:64-75 | Sources/Core/OpenAIModels.swift:114-125 \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 \u0060Sources/Core/OpenAIModels.swift:64\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":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"84b3ad9166b390822ef5134ef19ff504849bb88cfbb0088987de6caa2e16766c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): Sources/Core/OpenAIModels.swift:77-87 | Sources/Core/OpenAIModels.swift:126-136 | Sources/Core/OpenAIModels.swift:166-176 \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 \u0060Sources/Core/OpenAIModels.swift:77\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":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"891cd252d67acfd94553af1ef6b5397e21cf0dd534c73106d3eef52071d3b68b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Sources/CLI.swift:86-96 | Sources/CLI.swift:308-318 \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 \u0060Sources/CLI.swift:86\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. The matched lines also transfer control out of the body holding them, 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":"Sources/CLI.swift"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"05c03f38a855d1c9688bce7fb761da8c1d424f71962f98366659327eafc5c1c7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201310 lines \u00D7 2): Sources/BatchRunner.swift:127-134 | Sources/CLI.swift:64-73 \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 \u0060Sources/BatchRunner.swift:127\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":"Sources/BatchRunner.swift"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"a71a14b5c505a5af8aa02e5d627bbaddbdcc5b2c97149ca87152a7e80eefed00"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): Sources/Handlers.swift:392-401 | Sources/Handlers.swift:600-609 \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 \u0060Sources/Handlers.swift:392\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":"Sources/Handlers.swift"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd86bd3681900582cd7048e0eeacbd27213853d5d8aca7a833caab0b18f2b689"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): Sources/Server.swift:209-218 | Sources/Server.swift:459-467 \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 \u0060Sources/Server.swift:209\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":"Sources/Server.swift"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"be5837f9210e5efb1189b28a822112091ba1ff6e5e78d1c6be12603cefb10f85"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): Sources/Handlers.swift:393-401 | Sources/Handlers.swift:601-609 | Sources/Handlers.swift:1184-1192 \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 \u0060Sources/Handlers.swift:393\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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":"Sources/Handlers.swift"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"2eecf83f783082360b04edc8aa954cbbdf70aaf19fbee8e2bb32352da1b81b66"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): Sources/Core/ChatRequestValidator.swift:111-119 | Sources/Core/ResponsesModels.swift:300-308 \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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060Sources/Core/ResponsesModels.swift:299\u0060 calls \u0060invalidLastRole\u0060 and \u0060Sources/Core/ChatRequestValidator.swift:110\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":"Sources/Core/ChatRequestValidator.swift"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"b627c1028af6929e3fb97edacb795b07f495bb2c198b7d459162011dd310d47f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): Sources/Core/ToolCallHandler.swift:476-484 | Sources/Core/ToolCallHandler.swift:517-526 \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 \u0060Sources/Core/ToolCallHandler.swift:476\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":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"964fa63a3478da06c9fccc787908a35913faca407195073ed80c8626ba61d6c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): Sources/Handlers.swift:496-504 | Sources/Handlers.swift:1567-1575 \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 \u0060Sources/Handlers.swift:496\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a55b08932764e54c7efada585abbab2e993e77d746f3696dfe341916a93f577"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sources/Handlers.swift:86-97 | Sources/ResponsesHandlers.swift:106-113 \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 \u0060Sources/Handlers.swift:86\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":"Sources/Handlers.swift"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"a763b95cf656f8ff2486e1cea65080533ec7f702a604df287feaca9c3d3f0ad2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sources/Server.swift:183-190 | Sources/Server.swift:436-443 \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 \u0060Sources/Server.swift:183\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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Server.swift"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7a7847c4ad09d25f77d17961b17d188ff3e26c14ded5edc435844272839ba8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): Sources/Handlers.swift:960-966 | Sources/Handlers.swift:1042-1049 | Sources/Handlers.swift:1084-1091 | Sources/Handlers.swift:1344-1350 | Sources/Handlers.swift:1370-1376 \u2014 all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites \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 \u0060Sources/Handlers.swift:960\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":"Sources/Handlers.swift"},"region":{"startLine":960}}}],"partialFingerprints":{"codehealthFindingId/v1":"aedd6572bab8fe3c0ab9a82bd085b288ba654dc105143a86d759e7b01b48d519"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): Sources/ResponsesWire.swift:275-281 | Sources/ResponsesWire.swift:302-308 | Sources/ResponsesWire.swift:327-333 \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 \u0060Sources/ResponsesWire.swift:275\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":"Sources/ResponsesWire.swift"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfcbe55d6822e7eed62ae275f6eaed0e48314e25a70d35ef7e2dfa2d84b89d63"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sources/Core/ApfelError.swift:174-184 | Sources/Core/ApfelError.swift:287-293 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060Sources/Core/ApfelError.swift:174\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":"Sources/Core/ApfelError.swift"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0a4d84056a79b4ccd00b723932f820067a83662ecba80b5269e6577d2964eec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6\u20137 lines \u00D7 2): Sources/Handlers.swift:250-256 | Sources/ResponsesHandlers.swift:196-201 \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":"Sources/Handlers.swift"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"e22de777c5f47734889f9790ba180f5605ef84dc8e0343c714b76663686d9807"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): Sources/Handlers.swift:933-941 | Sources/Handlers.swift:944-952 \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":"Sources/Handlers.swift"},"region":{"startLine":933}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c230633226b1373f9f4260a44bb13d90dc6f6a686c0f2f17dbf0da1135210e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Sources/InputTokensHandler.swift:64-71 | Sources/ResponsesHandlers.swift:121-128 \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 \u0060Sources/InputTokensHandler.swift:64\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, \u0060Sources/ResponsesHandlers.swift:129\u0060 calls \u0060StructuredJSONRenderer\u0060 and \u0060Sources/InputTokensHandler.swift:72\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":"Sources/InputTokensHandler.swift"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"12e24fe1664bd42ed8aa8a9ff2b6996c97655278a1ae9a197b8bc3a4b18df539"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sources/Server.swift:195-201 | Sources/Server.swift:448-454 \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 \u0060Sources/Server.swift:195\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. The matched lines also transfer control out of the body holding them, 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":"Sources/Server.swift"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"daf445c58e115eda6018a0de88222142ceb53d2882b75dd0ad093124e2155467"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sources/Handlers.swift:360-366 | Sources/Handlers.swift:370-376 \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":"Sources/Handlers.swift"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"20946bc0912d15a5e2cbb3f78a3f74e3b2b7eac3e2c59d9c537391c0331678ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): Sources/Handlers.swift:1054-1060 | Sources/Handlers.swift:1358-1364 \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":"Sources/Handlers.swift"},"region":{"startLine":1054}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b389d8da8f208341aed62bf2fd1bfc6e8bc1f9bcf3ac7a3d9d926b0dae6937f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sources/Server.swift:149-153 | Sources/Server.swift:413-417 \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 \u0060Sources/Server.swift:149\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":"Sources/Server.swift"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"06ff2b8598b09658b1d103683da0aae565364609df97ee626140ebed0bba90f7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sources/Server.swift:155-159 | Sources/Server.swift:192-197 \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 \u0060Sources/Server.swift:155\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":"Sources/Server.swift"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"09bbfff1889542056632fa3f6391fb2cd8bbfb4e1526d0f1e4454788313c506f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sources/Core/SchemaParser.swift:855-859 | Sources/Core/SchemaParser.swift:864-868 \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 \u0060Sources/Core/SchemaParser.swift:855\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060Sources/Core/SchemaParser.swift:853\u0060 calls \u0060ws\u0060, \u0060readString\u0060, \u0060UInt8\u0060 and \u0060Sources/Core/SchemaParser.swift:863\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":"Sources/Core/SchemaParser.swift"},"region":{"startLine":855}}}],"partialFingerprints":{"codehealthFindingId/v1":"047d2ac653662074af9c4a06fe12cfe8451dd17a0eb4c352753ad54a79ff72ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sources/Handlers.swift:869-873 | Sources/Handlers.swift:1006-1010 \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 \u0060Sources/Handlers.swift:869\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":"Sources/Handlers.swift"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd584029353dd0bbb9511bcd9d0e2d6844758c6972e780810a51cad7296eaf99"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Sources/ResponsesHandlers.swift:483-487 | Sources/ResponsesHandlers.swift:518-522 \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 \u0060Sources/ResponsesHandlers.swift:483\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, \u0060Sources/ResponsesHandlers.swift:481\u0060 calls \u0060emit\u0060, \u0060ResponsesContentPartEvent\u0060, \u0060nextSeq\u0060 and \u0060Sources/ResponsesHandlers.swift:518\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":"Sources/ResponsesHandlers.swift"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"114cb3d27bbdffebc744af5fd23d3fbbbb95adad42c1021e703c1ed432cf3b46"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): mcp/calculator/server.py:148-163 | mcp/http-test-server/server.py:111-126 \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":"mcp/calculator/server.py"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"75eb7adf5ecb731f0e4beb7b15c5941f8b7eb253314dc3409e07e635ff82464b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): mcp/calculator/server.py:165-173 | mcp/http-test-server/server.py:128-135 \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":"mcp/calculator/server.py"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"c94b8178d40b6d9ebd0022bd52236104e171c95fb6416836a7b726a86c429fb1"}},{"ruleId":"D5","level":"warning","message":{"text":"Off the main sequence: ApfelCore: ApfelCore: abstractness 0.00, instability 0.00, distance 1.00 \u2014 zone of pain \u2014 concrete and depended on by 3 project(s), so it\u0027s rigid to change."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6d9259b0eda5192e835a0cba2bd860e54aacf49db91e8ec31757ca186931ae17"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: FoundationModelsBackend (LCOM4 7): FoundationModelsBackend\u0027s methods fall into 7 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 7 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":"Sources/Engine/FoundationModelsBackend.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ba745912f69e37994d674e5d01ac8172cb2ee82a6047ad19e01024504c7538a"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/CLI/CLIArguments.swift: Sources/CLI/CLIArguments.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 168 in CLIArguments.parse at line 408. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/CLI/CLIArguments.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/CLIArguments.swift"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb4ad87f582fccc8d7fe465cc429eeea531947f88241d67db05e50de455f5246"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/main.swift: Sources/main.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in main.swift.top-level code at line 15. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/main.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/main.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"03423dc925a61a3a762526433fd97155b32a23eca157275fcb455945bd408aae"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Handlers.swift: Sources/Handlers.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Handlers.swift.streamingResponse at line 685. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Handlers.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Handlers.swift"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc25c442ffc93f0616c515a97be6c94afd91ced1c6ccc4db77aa1f347956f002"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/CLI.swift: Sources/CLI.swift changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in CLI.swift.chat at line 470. 6 of those changes were fix/bug commits, and the other 8 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/CLI.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"20d96259a762dc0e7007f83a6477b75728f158b1892f89e35f0e08cc5eca2280"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Core/ChatRequestValidator.swift: Sources/Core/ChatRequestValidator.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in ChatRequestValidator.validate at line 227. 5 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/ChatRequestValidator.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ChatRequestValidator.swift"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd55e877bc61a5aca2f0cceeb41891ad6405c61cec90f3d4ee5ded3abb4bd845"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/ResponsesHandlers.swift: Sources/ResponsesHandlers.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ResponsesHandlers.swift.responsesStreamingResponse at line 374. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/ResponsesHandlers.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/ResponsesHandlers.swift"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"5926181923b447c3820fa5903050cdaf9153862dc7d3f912d4fdfdeadf44cf25"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Server.swift: Sources/Server.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Server.swift.startServer at line 60. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Server.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Server.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebc435fa705e6f4d32d7e6b0e80cbff194193d468740f3d16b7d59eb3a13fc93"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Core/ToolCallHandler.swift: Sources/Core/ToolCallHandler.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in ToolCallHandler.repairUnclosedContainers at line 474. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/ToolCallHandler.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"107fbba45e27056c1577a6d5d83e580c54a10cc4cef52554ba3a479ca5947469"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Core/ResponsesModels.swift: Sources/Core/ResponsesModels.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in ResponsesRequestValidator.validate at line 364. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/ResponsesModels.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ResponsesModels.swift"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf51585d4813f63b2ace1d3a708b5fb6e0dfbade8d7bb4683079180377a1243f"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Engine/TokenCounter.swift: Sources/Engine/TokenCounter.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in TokenCounter.fallbackCount at line 240. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Engine/TokenCounter.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/TokenCounter.swift"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6f9520430d4dc08a8be468045641839344f13ca067bb074ac780551b317f846"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: Sources/Core/MCPProtocol.swift: Sources/Core/MCPProtocol.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in MCPProtocol.validateToolArguments at line 109. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/MCPProtocol.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/MCPProtocol.swift"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc11fccc11a452133f5342fae3d9b6d69385d62b960de7a75a6791ca58cd7f55"}},{"ruleId":"D15","level":"warning","message":{"text":"Repeated repair: Sources/Core/OpenAIModels.swift: Sources/Core/OpenAIModels.swift changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file\u0027s churn. Its max cyclomatic complexity is 9 (its worst body is AnyCodable.init at line 603), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn \u00D7 complexity hotspot \u2014 the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: \u201Cfix(schema): generate properties in the declared order, server and CLI (#560) (#561)\u201D; \u201Cfix(server): enforce tool_choice and parallel_tool_calls at the response boundary (#480) (#489)\u201D; \u201Cfix(server): honor max_completion_tokens from modern OpenAI clients (#478) (#488)\u201D; \u201Cfix(validation): reject unknown message roles instead of silently dropping them (#405)\u201D. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/OpenAIModels.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":603}}}],"partialFingerprints":{"codehealthFindingId/v1":"0af0beaad896a94bddabd39a806c11563146361e6c0b7a114fcb67bf60327db5"}},{"ruleId":"D15","level":"warning","message":{"text":"Repeated repair: Sources/Core/ApfelError.swift: Sources/Core/ApfelError.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file\u0027s churn. Its max cyclomatic complexity is 15 (its worst body is ApfelError.cliLabel at line 105), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn \u00D7 complexity hotspot \u2014 the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: \u201Cfix(core): detect function-fenced tool calls, retry decodingFailure (#544) (#546)\u201D; \u201Cfix(review): never close a truncated string in tool-call repair, honour schema-valued additionalProperties, rate-limit before overflow keywords (#193)\u201D; \u201Cfix(macos27): classify case-less GenerationError, --code directive, 4096 docs, apfel-vs-fm page (#193, #194, #205)\u201D. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/ApfelError.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ApfelError.swift"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"0916c3cea28f889ee93d7d807e227b8dbee42ecc69dfbedf886cf56408e7ea81"}},{"ruleId":"D15","level":"warning","message":{"text":"Repeated repair: Sources/Core/Chat/StreamRetryPolicy.swift: Sources/Core/Chat/StreamRetryPolicy.swift changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file\u0027s churn. Its max cyclomatic complexity is 5 (its worst body is StreamPrintSink.feed at line 75), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn \u00D7 complexity hotspot \u2014 the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: \u201Cfix(streaming): compute deltas in Unicode scalars, not Characters (#543) (#545)\u201D; \u201Cfix(stream): detect a divergent retry instead of splicing two generations (#402)\u201D; \u201Cfix(output): survive a closed stdout or stderr pipe (#389)\u201D. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-08-15 22:26:10 \u002B01:00\u0027 --until=\u00272026-11-13 22:26:10 \u002B01:00\u0027 --full-history --no-merges -- Sources/Core/Chat/StreamRetryPolicy.swift\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/Chat/StreamRetryPolicy.swift"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcaa84bf76a0349290cfa1e7b33a4a6a7945c48aca424648e6518e062e888cc1"}},{"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. ADRs are expected here because \u0060Package.swift\u0060 makes this repository a deployable product (line 13)."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Package.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"61cb68a1ee6c4cb93e1c9ac7b48b28011c2bc672548de5c6ade44fdf2c34c979"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d5b8f11381d61a58459ffc7c595fd52d09c03c711894a63a9578043d2338412b"},"taxa":[{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A08:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"703b990f6d9a60db46de372b4bc3713bc769740b61be7dfed2b23b523664ac12"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c8381cdd9539330ccdf5f2819fb2f0ec8e0d20d645b1467a3e5e48700a37b69b"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ebac61d292e4757946ff83f15293e2fa751db1ae0044345ec1ca160a7804b230"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bc26593caf509b487cb3dff9d1a587737a02c72fc5e13e59c1a151f7d6412ad4"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6e8a627e7020ac8119c8ec6c60ce9a9f6a161d947c9dd66552a2bad9e055ffb9"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f57d1d312afdbea5e586f5c4277469ac5784f32d5ade2a108c78d246b6a0be52"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6bc3b539f953f180f304780b633bbb65e6d2911ce57503f2f0e4a05dfd504060"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a754bbfc26b1c8c9d00c9e7951f84a7cf839c5443c8b50c4dd7f2f2d5ea39c7f"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f5180979a5c3df099da129e2eb985e9ba4013538bfb342aa10fb3cf830312222"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"28fb95c74cf7e51a3f6e58d6d5d9aaba698bdc10ef21fbd45c72dc90736c26c6"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"037e2f084b53250061d3897daba6d66cb6e0c7b1c2feb70f9b6a71910f6a3dc8"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7a258fbecd881f027514c4a4c46daf0d1cdab07810521cc7ee16667ad8632d4c"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c000f45d19bfe3bfdbea8e9cadeafae6ddf900a31d0fec1f22b08392bec97066"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D34","level":"note","message":{"text":"Orphaned files with no living knowledge: 1 of 81 analysed file(s) have no living knowledge left \u2014 their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 81 of the 106 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each \u2014 most significant first: Sources/Core/TokenBudgetReport.swift. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ce861fd78f6935114d3a342cb90ad25870f984e1042954fcbbe27c0e23be3658"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/TokenBudgetReport.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"984fa0ee40acdbfa77eb559d3d74981f79457dbd5146edecef5e5b82210c2982"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"},"taxa":[{"id":"CICD-SEC-9","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"},"taxa":[{"id":"CICD-SEC-9","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"},"taxa":[{"id":"CICD-SEC-8","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"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":"P2","level":"warning","message":{"text":"No structured logging: No logging call was found in the 106 Python, Swift production file(s) this check read across 2 module(s). Each was searched for its ecosystem\u0027s logging libraries (Python: logging, structlog, loguru; Swift: os.Logger/os_log/NSLog, swift-log, CocoaLumberjack, SwiftyBeaver, XCGLogger) and for a call on a receiver named \u0060log\u0060/\u0060logger\u0060 (or ending in \u0060Logger\u0060/\u0060_logger\u0060) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read \u2014 this is \u0027no logging found by this walk\u0027, not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"9f10d71351c6778ebe84e761f82a90d4f9ed6c64f5e01975ede8fda7e4e2ebc5"}},{"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) as a CI step. What was searched, so you can tell an absence from a miss: the 1 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":[{"physicalLocation":{"artifactLocation":{"uri":".github/workflows/ci.yml"},"region":{"startLine":6}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P4","level":"note","message":{"text":"No release approval gate: The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY\u0027S PIPELINE FILES. What was read: every file under \u0060.github/workflows/\u0060, \u0060.forgejo/workflows/\u0060, \u0060.gitea/workflows/\u0060, \u0060.azuredevops/\u0060 and \u0060.azure-pipelines/\u0060, plus \u0060.gitlab-ci*\u0060 and \u0060azure-pipelines*\u0060 \u2014 with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab\u0027s \u0060when: manual\u0060, CircleCI\u0027s \u0060type: approval\u0060, an Azure \u0060ManualValidation@\u0060 task or an \u0060approvals:\u0060 block, a Jenkins \u0060input\u0060 step, a \u0060uses:\u0060 step naming an approval action, an \u0060environment:\u0060 paired with \u0060reviewers\u0060 / \u0060required_reviewers\u0060 / \u0060protection\u0060 / \u0060wait-timer\u0060 / \u0060deployment_branch_policy\u0060, a draft-release step, a \u0060workflow_dispatch\u0060 promotion, or a release-event gate. \u2605 What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy \u2014 all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6c11e2dbd483b4b423b95ac61bfcc7af1d55351b28a20d2b1105b31cfe38cc60"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060catch\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":885}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b84cb5dd3c17a418bdec875eb464ef3ffa0e33cefae50b5416620d8c2cd8a76"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060catch\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Engine/Summarizer.swift"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"14e3d46b64f5021ae22a27346511b45165f5d33d369653075029c44bafed4b6e"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060catch\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/OpenAIModels.swift"},"region":{"startLine":662}}}],"partialFingerprints":{"codehealthFindingId/v1":"da17e51cf5af1a456b5e3882e93e3d76c9cbe131365b3dbad9c35c2827423860"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060catch\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/Chat/StreamRetryPolicy.swift"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"83167b7750ab4478f7ec7e8acb6c2969a53859c26703fc842c0c6c53d158a897"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060catch\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI/ShellRunner.swift"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"906b45eaa7102198d83f7f3b72c0339542d559c7c684038b064075de2c617a3b"}},{"ruleId":"X6","level":"note","message":{"text":"Hand-rolled JSON/XML parsing via regex: A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand \u2014 malformed or differently-typed content (e.g. \u0060\u0022amount\u0022: \u00225\u0022\u0060 as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/Core/ToolCallHandler.swift"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"93e0c911c259a9e485acdd1846fd777702030f670dfcc3e6723c87732c5da589"}},{"ruleId":"X7","level":"note","message":{"text":"Silent fallback default in catch: \u0060shellPassthrough\u0060 turns every thrown error into \u00601\u0060 \u2014 a data error becomes a silent behavior change with no trail. Log the error or let it propagate (\u0060throws\u0060). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the \u0060catch\u0060, \u0060guard\u0060 or \u0060??\u0060, or in the doc comment, and the row stops firing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Sources/CLI.swift"},"region":{"startLine":885}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ad06baa6bdc685ed4827321b86f1f362461e5783969e59215cd2079e1871112"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1059","guid":"a2381a08-60f6-9554-a8b8-f3018cfaaca5","name":"Insufficient Technical Documentation","shortDescription":{"text":"Insufficient Technical Documentation"},"helpUri":"https://cwe.mitre.org/data/definitions/1059.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"Missing Support for Integrity Check","shortDescription":{"text":"Missing Support for Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-506","guid":"401d6455-56e3-0552-9a39-f77461673e3f","name":"Embedded Malicious Code","shortDescription":{"text":"Embedded Malicious Code"},"helpUri":"https://cwe.mitre.org/data/definitions/506.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)","shortDescription":{"text":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"Inclusion of Functionality from Untrusted Control Sphere","shortDescription":{"text":"Inclusion of Functionality from Untrusted Control Sphere"},"helpUri":"https://cwe.mitre.org/data/definitions/829.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Improper Control of Generation of Code (\u0027Code Injection\u0027)","shortDescription":{"text":"Improper Control of Generation of Code (\u0027Code Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]},{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61","version":"2025","organization":"OWASP Foundation","informationUri":"https://top10.owasp.org/2025/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10:2025 web application security risks."},"taxa":[{"id":"A02:2025","guid":"668dee9e-41bc-6354-97d0-fdf8f40c50c1","name":"Security Misconfiguration","shortDescription":{"text":"Security Misconfiguration"},"helpUri":"https://top10.owasp.org/2025/A02_2025-Security_Misconfiguration/"},{"id":"A03:2025","guid":"168e227c-7735-2e57-bc6e-997affe644c5","name":"Software Supply Chain Failures","shortDescription":{"text":"Software Supply Chain Failures"},"helpUri":"https://top10.owasp.org/2025/A03_2025-Software_Supply_Chain_Failures/"},{"id":"A05:2025","guid":"87e86033-3231-8458-8e4a-5cb82743553a","name":"Injection","shortDescription":{"text":"Injection"},"helpUri":"https://top10.owasp.org/2025/A05_2025-Injection/"},{"id":"A07:2025","guid":"334ddd78-539d-d35c-83dd-253647eb7eaf","name":"Authentication Failures","shortDescription":{"text":"Authentication Failures"},"helpUri":"https://top10.owasp.org/2025/A07_2025-Authentication_Failures/"},{"id":"A08:2025","guid":"84b0c297-710e-9a5f-9335-936ecb260c36","name":"Software or Data Integrity Failures","shortDescription":{"text":"Software or Data Integrity Failures"},"helpUri":"https://top10.owasp.org/2025/A08_2025-Software_or_Data_Integrity_Failures/"}]},{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35","organization":"OWASP Foundation","informationUri":"https://owasp.org/www-project-top-10-ci-cd-security-risks/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10 CI/CD Security Risks."},"taxa":[{"id":"CICD-SEC-8","guid":"b6b2dacf-a168-4957-876e-a8c73ee00eb0","name":"Ungoverned Usage of 3rd Party Services","shortDescription":{"text":"Ungoverned Usage of 3rd Party Services"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-08-Ungoverned-Usage-of-3rd-Party-Services"},{"id":"CICD-SEC-9","guid":"b3d36727-0395-5b51-94c4-5e173d62eab3","name":"Improper Artifact Integrity Validation","shortDescription":{"text":"Improper Artifact Integrity Validation"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-09-Improper-Artifact-Integrity-Validation"}]}],"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":17,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}