{"$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":"D8","name":"Code Coverage","shortDescription":{"text":"Code Coverage"},"helpUri":"https://codehealth.canine.dev/dimensions/D8"},{"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":"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":"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":"AX6","name":"Interface segregation","shortDescription":{"text":"Interface segregation"},"helpUri":"https://codehealth.canine.dev/dimensions/AX6"},{"id":"AX9","name":"CQS / query purity","shortDescription":{"text":"CQS / query purity"},"helpUri":"https://codehealth.canine.dev/dimensions/AX9"},{"id":"DM4","name":"Rich vs anemic domain model","shortDescription":{"text":"Rich vs anemic domain model"},"helpUri":"https://codehealth.canine.dev/dimensions/DM4"},{"id":"DM5","name":"Encapsulated state","shortDescription":{"text":"Encapsulated state"},"helpUri":"https://codehealth.canine.dev/dimensions/DM5"},{"id":"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":"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":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"P8","name":"Schema migrations","shortDescription":{"text":"Schema migrations"},"helpUri":"https://codehealth.canine.dev/dimensions/P8"},{"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":"X14","name":"Bypassable address classification","shortDescription":{"text":"Bypassable address classification"},"helpUri":"https://codehealth.canine.dev/dimensions/X14"},{"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":"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":"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":"X4","name":"Structured logging","shortDescription":{"text":"Structured logging"},"helpUri":"https://codehealth.canine.dev/dimensions/X4"},{"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":"DirectReducer.swift.directReducer (cyclomatic 90): DirectReducer.swift.directReducer has cyclomatic complexity 90 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/DirectReducer.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"6afe6cc1000b40460a3549719336f9f910b782153fa2166d3a415f1e1b7da0e8"}},{"ruleId":"D1","level":"warning","message":{"text":"WidgetCenter.swift.widgetCenterMiddleware (cyclomatic 36): WidgetCenter.swift.widgetCenterMiddleware has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/WidgetCenter/WidgetCenter.swift"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"d56901f894487ce4ddcb13800e51c00a9b66ab9576b0acf62479ed96d22f3fa5"}},{"ruleId":"D1","level":"warning","message":{"text":"LibreNFC.tagReaderSession (cyclomatic 34): LibreNFC.tagReaderSession has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/LibreConnection/LibreNFC.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0c1cc409e788b16c0ab218c0b783728380444b2682ca441b41aedd8854eae81"}},{"ruleId":"D1","level":"warning","message":{"text":"SensorConnector.swift.sensorConnectorMiddelware (cyclomatic 30): SensorConnector.swift.sensorConnectorMiddelware has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorConnector.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb8479859ea34018bc70dbf9dc88fae6c18c76c23c494ce83ecd13290aae0a29"}},{"ruleId":"D1","level":"warning","message":{"text":"BubbleConnection.peripheral (cyclomatic 23): BubbleConnection.peripheral 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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"af70882473719255076641978177fba539a2d71a86f4db61acfd6ecc79c4b2c5"}},{"ruleId":"D1","level":"warning","message":{"text":"AppleHealthExport.swift.appleHealthExportMiddleware (cyclomatic 23): AppleHealthExport.swift.appleHealthExportMiddleware 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":"App/Modules/AppleExport/AppleHealthExport.swift"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8907536bc8cea8eee58b479e451cd58c310c2071f94e4c65a762153d4242778"}},{"ruleId":"D1","level":"warning","message":{"text":"Nightscout.swift.nightscoutMiddleware (cyclomatic 22): Nightscout.swift.nightscoutMiddleware 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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"81704d7ff39b660d23c539f61d3c71dc80bebb55aa3120b9499b78218a6af538"}},{"ruleId":"D1","level":"warning","message":{"text":"ChartView.ChartView (cyclomatic 19): ChartView.ChartView 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":"App/Views/Overview/ChartView.swift"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"5858a56019d5b3abaed05d4237d255415f4712f1091d0879268805a309b5747e"}},{"ruleId":"D1","level":"warning","message":{"text":"LibreLinkUpConnection.processLogin (cyclomatic 17): LibreLinkUpConnection.processLogin 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":"App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"516fc09f19be8d8454c0bb99f67e99db098299a46d635dd52af6473e26588462"}},{"ruleId":"D1","level":"warning","message":{"text":"AppGroupSharing.swift.appGroupSharingMiddleware (cyclomatic 17): AppGroupSharing.swift.appGroupSharingMiddleware 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":"App/Modules/AppGroupSharing/AppGroupSharing.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"69469981f2a4c7a86f28e6bd2be53b20a0dec0d15ffccac30a71015d48d811d0"}},{"ruleId":"D1","level":"warning","message":{"text":"ConnectionNotification.swift.connectionNotificationMiddelware (cyclomatic 16): ConnectionNotification.swift.connectionNotificationMiddelware 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":"App/Modules/ConnectionNotification/ConnectionNotification.swift"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"1500135890f8179abe3b1fd70c0afab70b21e2f93ea7326c87bb036f999ef9bb"}},{"ruleId":"D2","level":"warning","message":{"text":"LibreNFC.tagReaderSession (cognitive 88): LibreNFC.tagReaderSession has cognitive complexity 88 (threshold 15). Drivers by points: if/else 22 (60 pts), loops 6 (12 pts), error handling 3 (7 pts), ternaries 3 (6 pts), match/switch 1 (3 pts) (nesting depth added 53). 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":"App/Modules/SensorConnector/LibreConnection/LibreNFC.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"f05c005d3de7ee12d19364bdd16340e3562f031e815c1674788e560d4e3cd4b0"}},{"ruleId":"D2","level":"warning","message":{"text":"DirectReducer.swift.directReducer (cognitive 49): DirectReducer.swift.directReducer has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (43 pts), boolean chains 5, 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":"Library/DirectReducer.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"baacdbac6ef1bf9f87a7a9d66fc447d40a74625b179aa403c6d01da6bf8ea86b"}},{"ruleId":"D2","level":"warning","message":{"text":"WidgetCenter.swift.widgetCenterMiddleware (cognitive 49): WidgetCenter.swift.widgetCenterMiddleware has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (41 pts), boolean chains 7, match/switch 1 (nesting depth added 17). 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":"App/Modules/WidgetCenter/WidgetCenter.swift"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9eb66e701bd51ee4697ba225ef17efd6bbc838da23bef3d33830e4d01e12a50"}},{"ruleId":"D2","level":"warning","message":{"text":"AppleHealthExport.swift.appleHealthExportMiddleware (cognitive 36): AppleHealthExport.swift.appleHealthExportMiddleware has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (35 pts), match/switch 1 (nesting depth added 17). 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":"App/Modules/AppleExport/AppleHealthExport.swift"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"001e79c0a2fc7f2c8c6ded7561e42636543f3b3293196a619a22770aa08d3e38"}},{"ruleId":"D2","level":"warning","message":{"text":"SensorConnector.swift.sensorConnectorMiddelware (cognitive 34): SensorConnector.swift.sensorConnectorMiddelware has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 7, ternaries 1 (2 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorConnector.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"895e1a011dcc281c5fffb2fc91979ce53807d96b873bff97cb03370a6f016eed"}},{"ruleId":"D2","level":"warning","message":{"text":"BubbleConnection.peripheral (cognitive 33): BubbleConnection.peripheral has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"df47665514325a2bf01ef6568ba72086f969a77c020f7056874ff5e1d219d2ac"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionView.body (cognitive 31): ConnectionView.body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 2 (nesting depth added 15). 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":"App/Views/Overview/ConnectionView.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"6291a2f11386c9a852322b2c86a2be3530ce6b8773b4b6498fff5fff50659c9d"}},{"ruleId":"D2","level":"warning","message":{"text":"GlucoseNotification.swift.glucoseNotificationMiddelware (cognitive 31): GlucoseNotification.swift.glucoseNotificationMiddelware has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (30 pts), match/switch 1 (nesting depth added 17). 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":"App/Modules/GlucoseNotification/GlucoseNotification.swift"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"55f9d438edd735f3edefd64b2bc04d786de198d50747457f6c1719f00cdfa3e1"}},{"ruleId":"D2","level":"warning","message":{"text":"StatisticsView.body (cognitive 27): StatisticsView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 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":"App/Views/Lists/StatisticsView.swift"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"32f962b9c1e8da305e2d95ceacfdc7308c1c98bb60f3466430084cd023971909"}},{"ruleId":"D2","level":"warning","message":{"text":"SensorView.body (cognitive 25): SensorView.body has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/SensorView.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4646073dbf71534cd6626aa4c3dfaec1bc47dc9dab30835fa64571301f9ff693"}},{"ruleId":"D2","level":"warning","message":{"text":"Nightscout.swift.nightscoutMiddleware (cognitive 25): Nightscout.swift.nightscoutMiddleware has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b225413415aa69a1b05f5588c67ba65123153569a35af032049a6adf410f0b7"}},{"ruleId":"D2","level":"warning","message":{"text":"ChartView.ChartView (cognitive 22): ChartView.ChartView has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/ChartView.swift"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd9382a48c21b4531ae8c29274fd68b727f7dd1dec6dc3baf8951f8e7e4187d9"}},{"ruleId":"D2","level":"warning","message":{"text":"LibreLinkUpConnection.processLogin (cognitive 22): LibreLinkUpConnection.processLogin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 10 (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":"App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"936a951928e5d0174d3c33bc72367e3455850c5df873ad625d3cd22bb168e7e4"}},{"ruleId":"D2","level":"warning","message":{"text":"LibreUtility.parseFRAM (cognitive 20): LibreUtility.parseFRAM has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (8 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f41976b2b58149a15da76302d776ecc32b52f92f41f16ee3352a00dec96a95d"}},{"ruleId":"D2","level":"warning","message":{"text":"Libre2Connection.peripheral (cognitive 20): Libre2Connection.peripheral has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, error handling 1 (3 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":"App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a5b2a9f92d7c20ee7fb5fb19b820f988c59630a080ee884e6090cc1c6e7e6e0"}},{"ruleId":"D2","level":"warning","message":{"text":"AppGroupSharing.swift.appGroupSharingMiddleware (cognitive 20): AppGroupSharing.swift.appGroupSharingMiddleware has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 1 (nesting depth added 7). 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":"App/Modules/AppGroupSharing/AppGroupSharing.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a6075d22bf3a616df17c6c783c9f9b9c0e716a8489245599117b6f965a90513"}},{"ruleId":"D2","level":"warning","message":{"text":"StoreExport.swift.storeExportMiddleware (cognitive 20): StoreExport.swift.storeExportMiddleware has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (9 pts), 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":"App/Modules/DataStore/StoreExport.swift"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6b93bd62e5b8086b7efc440965f44ea49848d3acaec7603ee4b51198aebdb08"}},{"ruleId":"D2","level":"warning","message":{"text":"GlucoseView.body (cognitive 19): GlucoseView.body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/GlucoseView.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9968f9660f6764acb2f7ceeac39d3709a83c01055dd253d3bbb670513d1475a"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionNotification.swift.connectionNotificationMiddelware (cognitive 19): ConnectionNotification.swift.connectionNotificationMiddelware has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/ConnectionNotification/ConnectionNotification.swift"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1ea82b875f99e38f93550b0f8d976be2d74da41bdea471285bc9bda8eb60f9d"}},{"ruleId":"D2","level":"warning","message":{"text":"GlucoseView.body (cognitive 17): GlucoseView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 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":"Widgets/GlucoseWidget.swift"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"280b167b2c18998b948691cf77f846a2bc9a4d2bdd2b3ba05d63bb94e01bd928"}},{"ruleId":"D2","level":"warning","message":{"text":"BellmanAlarmService.peripheral (cognitive 17): BellmanAlarmService.peripheral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/BellmanAlarm/BellmanAlarm.swift"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"03e945527def07929278a16f536bc126f1c0e85f99da0bf6fa80ed7555ddb5a1"}},{"ruleId":"D2","level":"warning","message":{"text":"AppleCalendarExport.swift.appleCalendarExportMiddleware (cognitive 16): AppleCalendarExport.swift.appleCalendarExportMiddleware has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). 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":"App/Modules/AppleExport/AppleCalendarExport.swift"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa017c00cb55426ee8b17725a0947e0fd0ff36178048ca739faf3c5a479ff58a"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: DirectReducer.swift.directReducer: FunctionTooLong \u2014 directReducer runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99\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":"Library/DirectReducer.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"817880493382e8f71f2eebe2fa5c150e86ef3e24cc8897786ce9c247c7b6cbac"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ChartView.ChartView: MethodTooLong \u2014 ChartView runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63\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":"App/Views/Overview/ChartView.swift"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"1772f55e88a93b9149b164b787e45be2e8aadecc51cdde8e9070b2d75c1bdd85"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: StoreExport.swift.storeExportMiddleware: FunctionTooLong \u2014 storeExportMiddleware runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/StoreExport.swift"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"eae949a27afd856decc20b129fa29cc3ca44ab5d5f65231f378b476c5b673d9f"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: ChartView: ClassTooLong \u2014 438 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 38 over it, 1.10\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/ChartView.swift"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b4103058cdad7197050d8108904bfcdf1e15ba99d03b14819354e794fb02b1d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: Overview/ChartView.swift: FileTooLong \u2014 534 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: ChartView (12-716). The bar is 500 significant lines; this is 34 over it, 1.07\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/ChartView.swift"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"acb56aa322149bc65cb644822e39fae2006dfa25b86469f4f2c913fcb95bcf81"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: DataStore: TooManyMethods \u2014 32 methods, declared across 6 files: DataStore/SensorGlucoseStore.swift (7), DataStore/BloodGlucoseStore.swift (6), DataStore/InsulinDeliveryStore.swift (6), DataStore/StoreExport.swift (6), \u002B2 more file(s). The bar is 30 methods; this is 2 over it, 1.07\u00D7 the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/DataStore.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"595500a861978d20ee524e421a4137a6a91252e50774b6151e6c89398cfe8d21"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: ChartViewCompatibility: ClassTooLong \u2014 417 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 17 over it, 1.04\u00D7 the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Overview/ChartViewCompatibility.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b6994b225f65c0e0070d477169da377993cc742380ff399e09afd38c0dc7677"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: LibreNFC.tagReaderSession: MethodTooLong \u2014 tagReaderSession 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":"App/Modules/SensorConnector/LibreConnection/LibreNFC.swift"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"588c68b63fb71201e997b21c77e4d062ef854aadad69c62d0f929d4e65768fdd"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: StatisticsView.body: MethodTooLong \u2014 body 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":"App/Views/Lists/StatisticsView.swift"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"1822f654e2a4a6f7c9f640c1744bf0b27fb8d096ef69ab97ad7535372ee5826f"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (9 members, 50\u002B identical tokens): App/Modules/Nightscout/Nightscout.swift:91-129 | App/Modules/Nightscout/Nightscout.swift:131-158 | App/Modules/Nightscout/Nightscout.swift:160-187 | App/Modules/Nightscout/Nightscout.swift:189-216 | App/Modules/Nightscout/Nightscout.swift:218-245 | App/Modules/Nightscout/Nightscout.swift:247-274 | App/Modules/Nightscout/Nightscout.swift:276-310 | App/Modules/Nightscout/Nightscout.swift:312-346 | App/Modules/Nightscout/Nightscout.swift:394-428 \u2014 These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \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 9 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 9 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"6141b9b0f58538d218d8f76b64958e2a2a01edddad1d5ada4d0583f1004ac39e"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): App/Modules/DataStore/BloodGlucoseStore.swift:172-201 | App/Modules/DataStore/InsulinDeliveryStore.swift:176-205 | App/Modules/DataStore/SensorErrorStore.swift:146-174 | App/Modules/DataStore/SensorGlucoseStore.swift:298-327 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f95d5f048c1575a70a06900c5a7f5b8cdf8869a5c3263bc09ea563ab8377ff6"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:279-320 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:322-377 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:379-410 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:412-447 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed1e62586ea92e309b7b48dd7c615ad154dd4f3edbf653aad7b00e9f554242e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 53\u002B corresponding lines): App/Views/Lists/BloodGlucoseListView.swift:13-65 | App/Views/Lists/InsulinDeliveryListView.swift:13-75 | App/Views/Lists/SensorGlucoseListView.swift:13-74 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 53 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":"App/Views/Lists/BloodGlucoseListView.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3cba25309b7ffae336b1f1db77410ac9afd4077a9b1f7a107a509961c85d08c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (36 corresponding lines): App/Modules/SensorConnector/LibreConnection/LibreConnection.swift:24-59 | App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift:15-50 \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":"App/Modules/SensorConnector/LibreConnection/LibreConnection.swift"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cde513c2729aa7904881d35d0f86638f670050b2b02bd18ce2bd261c5cb851b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (28 corresponding lines): App/Modules/GlucoseNotification/GlucoseNotification.swift:138-165 | App/Modules/GlucoseNotification/GlucoseNotification.swift:171-198 \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":"App/Modules/GlucoseNotification/GlucoseNotification.swift"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"69828f442357bf9d353d9b5e23e7868bf2d4779468a917b496ff4e2d6bcc16d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (36 corresponding lines): App/Modules/AppleExport/AppleHealthExport.swift:172-207 | App/Modules/AppleExport/AppleHealthExport.swift:232-269 \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":"App/Modules/AppleExport/AppleHealthExport.swift"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc451d392b6cd0a1479c22931f76d743ef1858f3d7f2345ab8f71b036a4d1257"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (27 corresponding lines): Library/Content/Sensor.swift:170-196 | Library/Content/Sensor.swift:224-252 \u2014 These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Library/Content/Sensor.swift"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae0c52b15dda8283c0955bd025138c045d313b2f17618999c1651c0b6a94d91f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): Library/Content/Calibrations/FactoryCalibration.swift:66-80 | Library/Content/Calibrations/FactoryCalibration.swift:82-97 \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":"Library/Content/Calibrations/FactoryCalibration.swift"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c3a67a7d5cc876af27d8b80d2e6e8baf0deac8afffe3a0bb9d75e3d35e8b6da"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (27 corresponding lines): App/Modules/ExpiringNotification/ExpiringNotification.swift:78-104 | App/Modules/ExpiringNotification/ExpiringNotification.swift:106-136 \u2014 These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"App/Modules/ExpiringNotification/ExpiringNotification.swift"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"39e44b66d2b00a22f5ee5d8618a6ad7fd99de685b772d3ef07f3a98f22234aec"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 22\u002B corresponding lines): App/Modules/DataStore/BloodGlucoseStore.swift:79-100 | App/Modules/DataStore/InsulinDeliveryStore.swift:77-104 | App/Modules/DataStore/SensorErrorStore.swift:73-94 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 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":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fbe7ee576a35203dcf853a677e529d699928aad1636d639e4ab2548e9c04b71"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (30 corresponding lines): App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift:52-81 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:59-88 \u2014 These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e280e8cea5bc9d135b544d045fdc40106294eca588883813abf605dfda025fc"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): App/Modules/SensorConnector/SensorUtility.swift:275-282 | App/Modules/SensorConnector/SensorUtility.swift:284-291 \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":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9b755c8151054c61845487e168e2e8e0e680e7a5a356bedaed1c3285d6f443d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (27 corresponding lines): App/Views/AddViews/AddBloodGlucoseView.swift:19-53 | App/Views/AddViews/AddCalibrationView.swift:19-45 \u2014 These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"App/Views/AddViews/AddBloodGlucoseView.swift"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"496ccb8ae72b58fde39c7980cfd3b9cc1a08df90b4a2300af5b5099e439ace64"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): App/Views/Overview/ChartView.swift:821-840 | App/Views/Overview/ChartView.swift:842-866 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"App/Views/Overview/ChartView.swift"},"region":{"startLine":821}}}],"partialFingerprints":{"codehealthFindingId/v1":"7df9fe0683b2c3b0f282c79a1c5473262ec475320408a03b9246a63921befe82"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 18\u002B corresponding lines): App/Views/Overview/ChartViewCompatibility.swift:462-479 | App/Views/Overview/ChartViewCompatibility.swift:481-498 | App/Views/Overview/ChartViewCompatibility.swift:548-565 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"App/Views/Overview/ChartViewCompatibility.swift"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"64dd887e9b4c94781f21641567d1af7b31f6c7f92aea0d13f8daab4904b48f64"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 19\u002B corresponding lines): App/Modules/DataStore/BloodGlucoseStore.swift:152-170 | App/Modules/DataStore/InsulinDeliveryStore.swift:156-174 | App/Modules/DataStore/SensorGlucoseStore.swift:278-296 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"34485fee9b67d94ccd49eb18f5ba7d7f197fb2cbbade356f4bc13a29e9f19171"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): Widgets/SensorWidget.swift:99-118 | Widgets/TransmitterWidget.swift:73-92 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Widgets/SensorWidget.swift"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6194ac87c73a086329a11a93e92ac5b335b30fdfc30630cfd08286665dddccc"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): App/Views/Overview/ChartView.swift:779-795 | App/Views/Overview/ChartView.swift:803-819 \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":"App/Views/Overview/ChartView.swift"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e371229199d3f9710059058469102be2acf06b4345b2fcb2861b50936fc29d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 16\u002B corresponding lines): Library/Content/Sensor.swift:13-29 | Library/Content/Sensor.swift:31-47 | Library/Content/Sensor.swift:49-64 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"Library/Content/Sensor.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"dde53032320335586a7728aaf9dadcdb62a7ee9e70b4d2596329eb1050153dde"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): App/Modules/AppGroupSharing/AppGroupSharing.swift:168-180 | App/Modules/AppGroupSharing/AppGroupSharing.swift:184-196 \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":"App/Modules/AppGroupSharing/AppGroupSharing.swift"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a464f354dcc3d567b41f41d459fe46c95b40b8dbcac3177ff8ba62b47735bb4"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): Library/Content/InsulinDelivery.swift:39-49 | Library/Content/InsulinDelivery.swift:51-61 \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":"Library/Content/InsulinDelivery.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"49201dde31c456fd3fd753f6f76879f878020da7695ca835b0edb5603a970903"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): App/Modules/Nightscout/Nightscout.swift:474-486 | App/Modules/Nightscout/Nightscout.swift:490-505 \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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9d52f8e99c1763b6e2f0713cd4f3e4fb02b191915a9dfecb84dc233e89ece64"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 10\u002B corresponding lines): Widgets/GlucoseWidget.swift:57-66 | Widgets/SensorWidget.swift:76-85 | Widgets/TransmitterWidget.swift:50-59 \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":"Widgets/GlucoseWidget.swift"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b1b27f7bd86ac1297990417081762964e352a7d271f3969a72976feed27f66a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:46-63 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:102-118 \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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdb470402451c00ea4934562c332858d8321c5e3ba0abf9ee9d61c702db33f14"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): App/Modules/AppleExport/AppleCalendarExport.swift:110-132 | App/Modules/AppleExport/AppleCalendarExport.swift:181-201 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/AppleExport/AppleCalendarExport.swift"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dc8447a29b26530692ac90bb7702d10175b109cef7329f9234e95738eb4f43a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 11\u002B corresponding lines): Library/Content/SensorGlucose.swift:56-66 | Library/Content/SensorGlucose.swift:68-78 | Library/Content/SensorGlucose.swift:80-90 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"Library/Content/SensorGlucose.swift"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"a72af32b8b6ae3b3a48646737ef7c0b5e93f59d293a9aadeb736879a96826cdd"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 3\u002B corresponding lines): Library/DirectLog.swift:23-25 | Library/DirectLog.swift:27-29 | Library/DirectLog.swift:31-33 | Library/DirectLog.swift:35-37 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 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":"Library/DirectLog.swift"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"b143a4a8ad9760ffaf269b047cab1b94a65ca48380620c1f0aa89824748b472a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 11\u002B corresponding lines): App/Views/Settings/AlarmSettingsView.swift:84-94 | App/Views/Settings/AlarmSettingsView.swift:96-106 | App/Views/Settings/AlarmSettingsView.swift:108-118 | App/Views/Settings/AlarmSettingsView.swift:120-130 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"App/Views/Settings/AlarmSettingsView.swift"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"9134e8a9271a5323193af40ad82a57bbaba745b000afe0c6dd9f42d7831d3136"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (8 members, 15\u002B corresponding lines): App/Modules/DataStore/BloodGlucoseStore.swift:102-116 | App/Modules/DataStore/BloodGlucoseStore.swift:118-132 | App/Modules/DataStore/InsulinDeliveryStore.swift:106-120 | App/Modules/DataStore/InsulinDeliveryStore.swift:122-136 | App/Modules/DataStore/SensorErrorStore.swift:96-110 | App/Modules/DataStore/SensorErrorStore.swift:112-126 | App/Modules/DataStore/SensorGlucoseStore.swift:175-189 | App/Modules/DataStore/SensorGlucoseStore.swift:191-205 \u2014 These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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 8 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"426d024b1b79513fe313525bfca60cb606e8e81bcb399a989152e0f9c6068f6e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 11\u002B corresponding lines): App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:34-44 | App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:76-86 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:90-100 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e328edf72c12ae6ffe3b799952a1db8228142a4f1eca438a167806ce914082c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): Library/Content/SensorState.swift:23-40 | Library/Content/SensorState.swift:42-59 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \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":"Library/Content/SensorState.swift"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a430874238243f984e99122ed2d50bd9e251a9e18df84a4cf1c2c67cd28b98a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (4 corresponding lines): Library/Extensions/Double.swift:9-12 | Library/Extensions/Int.swift:138-141 \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":"Library/Extensions/Double.swift"},"region":{"startLine":9}}}],"partialFingerprints":{"codehealthFindingId/v1":"09450ba1a31da75a7058039081133512bfde962561889432ff22c93d1eda37e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 8\u002B corresponding lines): Library/Content/BloodGlucose.swift:13-20 | Library/Content/BloodGlucose.swift:22-29 | Library/Content/SensorError.swift:13-20 | Library/Content/SensorError.swift:22-29 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\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":"Library/Content/BloodGlucose.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"522cad76e56c518ceded7426cec18e738f607405f6736c8a0752da5283f39177"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (7 corresponding lines): App/Modules/SensorConnector/SensorBluetoothConnection.swift:24-32 | App/Modules/BellmanAlarm/BellmanAlarm.swift:72-78 \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":"App/Modules/SensorConnector/SensorBluetoothConnection.swift"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"e64800bfef1594c65b842ee42180e47afff45abcb73cabfd63e5cee9ffce8c91"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 3\u002B corresponding lines): App/Modules/DataStore/Migration.swift:84-86 | App/Modules/DataStore/Migration.swift:135-137 | Library/Content/SensorGlucose.swift:130-132 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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":"App/Modules/DataStore/Migration.swift"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5cdfef00150d39cbc461a2667a253efbfe30c33477006039e0fe8cb5307c9d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (3 corresponding lines): Library/Extensions/Double.swift:40-42 | Library/Extensions/Float.swift:11-13 \u2014 These two members are one piece of code written twice and then edited apart: 3 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":"Library/Extensions/Double.swift"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"6182151cfd6aa8f438edb73c144becee207aa1e6ad0d0321fe4a84d9c6788fe4"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 3\u002B corresponding lines): App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:15-18 | App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:15-17 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:16-18 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"3450c27273770167ca8bc21d0b2d79026b7f750f52af70315912e2cc2fa82b62"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (7 corresponding lines): App/Views/Overview/GlucoseView.swift:130-136 | Widgets/GlucoseActivityWidget.swift:95-101 \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":"App/Views/Overview/GlucoseView.swift"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"22574a7696a9bd8f1dad3d6e54d86197e13236cc59c30fc5896cb39d92541433"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 3\u002B corresponding lines): App/Views/Lists/BloodGlucoseListView.swift:71-73 | App/Views/Lists/InsulinDeliveryListView.swift:81-83 | App/Views/Lists/SensorErrorListView.swift:67-69 | App/Views/Lists/SensorGlucoseListView.swift:80-82 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 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":"App/Views/Lists/BloodGlucoseListView.swift"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ab8b0dd20093f0b5bc438f65e6ca53f54de9146ca820925b34cfe8ce3535878"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (48 lines \u00D7 2): App/Modules/DataStore/StoreExport.swift:106-153 | App/Modules/DataStore/StoreExport.swift:161-208 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Modules/DataStore/StoreExport.swift:106\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060App/Modules/DataStore/StoreExport.swift:160\u0060 calls \u0060TimeZone\u0060 and \u0060App/Modules/DataStore/StoreExport.swift:105\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":"App/Modules/DataStore/StoreExport.swift"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"f171c01b918543bf6721a58635ee66affc7abecea389fddb0317b977c9f407c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (27 lines \u00D7 2): App/App.swift:116-142 | App/App.swift:156-182 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/App.swift"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"adf71f50c76bbf5db210df7de4b8af4623a7de95e3c6cb84e8d5c1086b4a63a3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): App/Modules/GlucoseNotification/GlucoseNotification.swift:139-161 | App/Modules/GlucoseNotification/GlucoseNotification.swift:172-194 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/GlucoseNotification/GlucoseNotification.swift:139\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":"App/Modules/GlucoseNotification/GlucoseNotification.swift"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"e68f20ebdc84ee1a2cd310695624f54b9db7e07bfac911c9479d8b8517afd7d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 4): App/Modules/Nightscout/Nightscout.swift:98-118 | App/Modules/Nightscout/Nightscout.swift:281-301 | App/Modules/Nightscout/Nightscout.swift:317-337 | App/Modules/Nightscout/Nightscout.swift:399-419 \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 \u0060App/Modules/Nightscout/Nightscout.swift:98\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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"b256f853ff77ec41356c1b776ef1cfe4b2c149b6e196fba9351ca1ff7d865a0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): App/Modules/AppleExport/AppleHealthExport.swift:210-230 | App/Modules/AppleExport/AppleHealthExport.swift:272-292 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/AppleExport/AppleHealthExport.swift"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"348951eec6b56a7002686e0c476be60bc4e55cd8f9f8c7e4192cbe151578cb79"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): App/Modules/SensorConnector/LibreConnection/LibreConnection.swift:39-59 | App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift:30-50 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/SensorConnector/LibreConnection/LibreConnection.swift:39\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":"App/Modules/SensorConnector/LibreConnection/LibreConnection.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb75f650b08a57da0f3bc583c0063db8e622a411e0f227e0cf47f1a511d5c46d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): App/Modules/SensorConnector/SensorUtility.swift:22-41 | App/Modules/SensorConnector/SensorUtility.swift:55-74 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/SensorConnector/SensorUtility.swift:22\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"aad85c969fe4aeefd0374a9a764eacf0dbd827c0866bcedad46d8129ea0a5afe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16\u201317 lines \u00D7 6): App/Modules/Nightscout/Nightscout.swift:113-129 | App/Modules/Nightscout/Nightscout.swift:143-158 | App/Modules/Nightscout/Nightscout.swift:172-187 | App/Modules/Nightscout/Nightscout.swift:201-216 | App/Modules/Nightscout/Nightscout.swift:230-245 | App/Modules/Nightscout/Nightscout.swift:259-274 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \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 \u0060App/Modules/Nightscout/Nightscout.swift:113\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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"4364829b679d3c118cbfec4326cd106c882075fb6d6782501fb21e2117317c2c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): App/Modules/SensorConnector/SensorUtility.swift:335-351 | Library/Content/Calibrations/FactoryCalibration.swift:100-116 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b4a62bd09c11964215f72d6859ada9fa9df7ed858b53de564d8914a4cf33f40"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): App/Views/Overview/GlucoseView.swift:30-46 | Widgets/GlucoseActivityWidget.swift:124-140 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Views/Overview/GlucoseView.swift:30\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. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060verbatim\u0060 to \u0060latestGlucose.trend.description) .foregroundColor(getGlucoseColor(glucose: latestGlucose)) .font(.system(size: 52)) if let minuteChange = latestGlucose.minuteChange?.asMinuteChange(glucoseUnit: store.state.glucoseUnit\u0060 in one and \u0060latestGlucose.trend.description) .font(.system(size: 34)) if let minuteChange = latestGlucose.minuteChange?.asMinuteChange(glucoseUnit: glucoseUnit\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060App/Views/Overview/GlucoseView.swift:48\u0060 calls \u0060cornerRadius\u0060 and \u0060Widgets/GlucoseActivityWidget.swift:142\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":"App/Views/Overview/GlucoseView.swift"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ecf7201c05fd4ae27ebc58b7531ceb763d5d71a49b3f82c50cd32619137f43f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 3): App/Modules/DataStore/BloodGlucoseStore.swift:135-150 | App/Modules/DataStore/InsulinDeliveryStore.swift:139-154 | App/Modules/DataStore/SensorErrorStore.swift:129-144 \u2014 before extracting anything, compare \u0060App/Modules/DataStore/BloodGlucoseStore.swift\u0060 and \u0060App/Modules/DataStore/InsulinDeliveryStore.swift\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"40f0621f8092006319d2c456d9ad33b0a545725f735ac10cdc4141f91ddb95e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201315 lines \u00D7 3): App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift:53-66 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:60-73 | App/Modules/SensorConnector/SensorBluetoothConnection.swift:107-121 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/SensorConnector/SensorBluetoothConnection.swift:107\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":"App/Modules/SensorConnector/LibreConnection/LibreLinkConnection.swift"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a41e72438297ef07947b993e992408d828cc77955d3ffb1c80f62e8cc1af024"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): App/Views/Lists/StatisticsView.swift:99-112 | App/Views/Lists/StatisticsView.swift:115-128 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Views/Lists/StatisticsView.swift:99\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Lists/StatisticsView.swift"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c648f4cc7941a8ea4f6da02c6b5b2536363a50f88e7c6739b9c4165c620895c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): Widgets/SensorWidget.swift:106-118 | Widgets/TransmitterWidget.swift:80-92 \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 \u0060Widgets/SensorWidget.swift:106\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":"Widgets/SensorWidget.swift"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc034c243628979bfd8e0b97e474fa2ce02e5abd95891f428651d9abfd758b64"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 3): App/Modules/WidgetCenter/WidgetCenter.swift:30-46 | App/Modules/WidgetCenter/WidgetCenter.swift:79-95 | App/Modules/WidgetCenter/WidgetCenter.swift:98-114 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/WidgetCenter/WidgetCenter.swift"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c7cee2ab4e8fe52b80577739bcefc620d7010d3015b514e6ce724103a23655"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): App/Views/Overview/ChartViewCompatibility.swift:463-474 | App/Views/Overview/ChartViewCompatibility.swift:482-493 | App/Views/Overview/ChartViewCompatibility.swift:549-560 \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 \u0060App/Views/Overview/ChartViewCompatibility.swift:463\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":"App/Views/Overview/ChartViewCompatibility.swift"},"region":{"startLine":463}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b037d49be26cb462ff6ecc87579c3e9ed04886be916af9230939bc04e6ebf09"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): App/Modules/AppleExport/AppleHealthExport.swift:173-184 | App/Modules/AppleExport/AppleHealthExport.swift:233-244 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Modules/AppleExport/AppleHealthExport.swift:173\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":"App/Modules/AppleExport/AppleHealthExport.swift"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"f77025a36f1d37bd104914ad4d4bd32ee34c313126a06dac51c3c172e0eaf3de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): Library/Content/Sensor.swift:171-181 | Library/Content/Sensor.swift:225-235 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060Library/Content/Sensor.swift:237\u0060 calls \u0060Data\u0060 and \u0060Library/Content/Sensor.swift:183\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":"Library/Content/Sensor.swift"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6c0db55c64b33f22852f719783b4195da737009f6dbd4e594e80e57a1c3baf8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 4): App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:304-313 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:359-368 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:392-401 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:429-438 \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 \u0060App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:304\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b201e5cb7fe169be7702f91e57230a0629bd3472c26e88b9701faca5bb583ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): App/Views/Overview/ChartView.swift:210-218 | App/Views/Overview/ChartView.swift:248-257 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Views/Overview/ChartView.swift:210\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. 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":"App/Views/Overview/ChartView.swift"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"060341ee2155e26965f0bbf35ebd28217ab916241bae82bdd7158a6c94935cf1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): App/Modules/Nightscout/Nightscout.swift:190-198 | App/Modules/Nightscout/Nightscout.swift:219-227 | App/Modules/Nightscout/Nightscout.swift:248-256 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c5c01a998e7fca28eab1b22c60a7c1a35ce95a44b401ac2d36dcd3336d174ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): App/Modules/BellmanAlarm/BellmanAlarm.swift:39-47 | App/Modules/GlucoseNotification/GlucoseNotification.swift:28-36 \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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060App/Modules/GlucoseNotification/GlucoseNotification.swift:25\u0060 calls \u0060setGlucoseNotification\u0060, \u0060addSensorGlucose\u0060 and \u0060App/Modules/BellmanAlarm/BellmanAlarm.swift:37\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":"App/Modules/BellmanAlarm/BellmanAlarm.swift"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"84bbe4b076876602cfe93853ff58b15bca5762795ffa5bc894e23eced46413d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): App/Modules/Nightscout/Nightscout.swift:132-140 | App/Modules/Nightscout/Nightscout.swift:161-169 \u2014 both copies are in the same file, so extract the block 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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"70dfc71df3fe2598d259c3327d5fa43dfa49fa1671a2a506d6448772ca68124c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): App/Modules/Nightscout/Nightscout.swift:474-481 | App/Modules/Nightscout/Nightscout.swift:490-497 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Modules/Nightscout/Nightscout.swift:474\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, \u0060App/Modules/Nightscout/Nightscout.swift:499\u0060 calls \u0060toNightscoutDirection\u0060, \u0060toNightscoutTrend\u0060 and \u0060App/Modules/Nightscout/Nightscout.swift:482\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":"App/Modules/Nightscout/Nightscout.swift"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3545efbb69228829985c9a6cb6a5702203e468001974344179f6702cdd289bc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): App/Modules/SensorConnector/LibreConnection/LibreNFC.swift:163-170 | App/Modules/SensorConnector/LibreConnection/LibreNFC.swift:177-184 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Modules/SensorConnector/LibreConnection/LibreNFC.swift:163\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/LibreConnection/LibreNFC.swift"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"63111b0596842ebf4f698f7893d657f0f7dd903e138c432002350a95d7478a1e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): Library/Content/SensorGlucose.swift:59-66 | Library/Content/SensorGlucose.swift:71-78 \u2014 both copies are in the same file, so extract the block 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 \u0060Library/Content/SensorGlucose.swift:59\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":"Library/Content/SensorGlucose.swift"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"6655ac29672f0c30decef96c56d39fdbd89d9962ac004241ff5dab0552f46b6e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): App/Modules/DataStore/BloodGlucoseStore.swift:173-179 | App/Modules/DataStore/InsulinDeliveryStore.swift:177-183 | App/Modules/DataStore/SensorErrorStore.swift:147-153 | App/Modules/DataStore/SensorGlucoseStore.swift:299-305 \u2014 before extracting anything, compare \u0060App/Modules/DataStore/BloodGlucoseStore.swift\u0060 and \u0060App/Modules/DataStore/InsulinDeliveryStore.swift\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/DataStore/BloodGlucoseStore.swift:173\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":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f1c8f8b81dc1a8f5f66d46b302fba183d99f8704469312b20ef305575ea582e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): App/Modules/GlucoseNotification/GlucoseNotification.swift:126-132 | App/Modules/GlucoseNotification/GlucoseNotification.swift:159-165 | App/Modules/GlucoseNotification/GlucoseNotification.swift:192-198 \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 \u0060App/Modules/GlucoseNotification/GlucoseNotification.swift:126\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":"App/Modules/GlucoseNotification/GlucoseNotification.swift"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"18db1d97355d3e3cfdb55cf17978000265a340038d5b4777dd0dfd7bd95cca03"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): App/Modules/AppGroupSharing/AppGroupSharing.swift:41-55 | App/Modules/AppGroupSharing/AppGroupSharing.swift:60-74 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. 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":"App/Modules/AppGroupSharing/AppGroupSharing.swift"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"d87a83827fda5f94f68d1ae05f9c6ccdd38bfa4426442c28b787cf6d74c09bba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:47-53 | App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:89-95 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:47\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, \u0060App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:55\u0060 calls \u0060setNotifyValue\u0060 and \u0060App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:97\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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"db06c6d940cbd398028e11641d5052276aad2e8ff68a1eee5c951cd9ef952354"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:46-51 | App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:88-93 | App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift:102-107 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:46\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, \u0060App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift:55\u0060 calls \u0060setNotifyValue\u0060 and \u0060App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift:97\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":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"39515adde826fd0006fd3d5da1b7bde36ad3424c773f21c27e8e64f336d831bd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): App/Modules/SensorConnector/LibreConnection/LibreNFC.swift:155-160 | App/Modules/SensorConnector/LibreConnection/LibreNFC.swift:169-174 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/LibreConnection/LibreNFC.swift"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8c35772da6f17b9cac80f05215704c78174156274e86cce933d5094dbacbd5e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (3\u20136 lines \u00D7 3): App/Modules/SensorConnector/SensorUtility.swift:46-51 | App/Modules/SensorConnector/SensorUtility.swift:80-85 | App/Modules/SensorConnector/SensorUtility.swift:237-239 \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 \u0060App/Modules/SensorConnector/SensorUtility.swift:46\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"19f8d52e9dd11f7c6072030dc25fd7deb4ae20a01673d1a18fe1c3829db7e0e4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): App/Modules/AppGroupSharing/AppGroupSharing.swift:168-172 | App/Modules/AppGroupSharing/AppGroupSharing.swift:184-188 \u2014 both copies are in the same file, so extract the block 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 \u0060App/Modules/AppGroupSharing/AppGroupSharing.swift:168\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":"App/Modules/AppGroupSharing/AppGroupSharing.swift"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ffb528ccd1f1184d4944e6abfd407239f9fda4bcc53cdbfe9362111b67ea691"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (65 lines \u00D7 3): App/Modules/DataStore/BloodGlucoseStore.swift:12-76 | App/Modules/DataStore/InsulinDeliveryStore.swift:10-74 | App/Modules/DataStore/SensorGlucoseStore.swift:52-116 \u2014 before extracting anything, compare \u0060App/Modules/DataStore/BloodGlucoseStore.swift\u0060 and \u0060App/Modules/DataStore/InsulinDeliveryStore.swift\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/BloodGlucoseStore.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"372df196207317642acffdbfcd66bcc27a12f5e92699d089952e44d3fc2167c3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): App/Views/Lists/StatisticsView.swift:42-46 | App/Views/Overview/ChartView.swift:565-570 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Views/Lists/StatisticsView.swift"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ec993e794f03d79e90630267be7ffce4962c5c04e2ff6132c8cbeeb21c3d7bd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): Library/Content/Glucose.swift:19-23 | Library/Content/SensorError.swift:46-50 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/Content/Glucose.swift"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"331bb92256f3eb45dc880030c4143a923a88f78c114911412617453bc48d7259"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): Widgets/GlucoseWidget.swift:51-55 | Widgets/SensorWidget.swift:70-74 | Widgets/TransmitterWidget.swift:44-48 \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. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060completion\u0060 to \u0060@escaping (GlucoseEntry) -\u003E ()\u0060 in one and \u0060@escaping (SensorEntry) -\u003E ()\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Widgets/GlucoseWidget.swift"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc1e8dad277533984ff17e8cc88c3ef210be1a4b762ae6fc686fb4e50df978d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): App/Views/Overview/ChartViewCompatibility.swift:86-93 | App/Views/Overview/ChartViewCompatibility.swift:98-105 \u2014 both copies are in the same file, so extract the block 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":"App/Views/Overview/ChartViewCompatibility.swift"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"965f7e29cab48074781fe8b0426a0252657697efe9c1f62e60aa75bd5267eb67"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: DataStore (LCOM4 22): DataStore\u0027s methods fall into 22 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 22 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/DataStore.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"b69bc92d94d6d9b06605c0fbddc1f20f44c455eff2b66505f00174f2a34fb32d"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: DirectNotifications (LCOM4 8): DirectNotifications\u0027s methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 8 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":"Library/DirectNotifications.swift"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"9165a608ab28d419d46653e60e131085b68983e352f7f7602fe1e75e72763bc5"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Date (LCOM4 8): Date\u0027s methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 8 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":"Library/Extensions/Date.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a970291a2b7c65c42338ca8c63fddaf133723443e437472813612720cdf150e"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Int (LCOM4 8): Int\u0027s methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 8 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":"Library/Extensions/Int.swift"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ebfcb024c5c57bcff68b07630b32d4debd5d45312a08adc6026d6d99da4039a"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: GlucoseDirectAppDelegate (LCOM4 7): GlucoseDirectAppDelegate\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":"App/App.swift"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5ebb642174be4eb52490a79d41dd5cb2cee5c8a8900fcd5ba768bce7a9e945c"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: BellmanAlarmService (LCOM4 6): BellmanAlarmService\u0027s methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 6 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":"App/Modules/BellmanAlarm/BellmanAlarm.swift"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc8937cc1fc554ea318f8de21aeeb9ef3ec86ab642aa85e3655c3ee0e8689e0f"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Libre2Connection (LCOM4 6): Libre2Connection\u0027s methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 6 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":"App/Modules/SensorConnector/LibreConnection/Libre2Connection.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"6926b95a4af2407b7eb6f64af2e40175e024795f4f704beabfb7ab61afa184f9"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: LibreLinkUpConnection (LCOM4 6): LibreLinkUpConnection\u0027s methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \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 6 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":"App/Modules/SensorConnector/LibreConnection/LibreLinkUpConnection.swift"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e0e289450aa424e45f08ac0b8002bab80a4bb4c0bacc8976aedf693a4cb6a7b"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: GlucoseNotificationService (LCOM4 5): GlucoseNotificationService\u0027s methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/GlucoseNotification/GlucoseNotification.swift"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2245a1cced7d1c1767bb0b4bc28417bfa96afbce8f52f7bd2fe1d87e6e5647f"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Array (LCOM4 5): Array\u0027s methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/Content/SensorGlucose.swift"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"99b29c59148d185136e4e60c0556e2f0edad29e724ec808e9112f956227b58ff"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: BubbleConnection (LCOM4 4): BubbleConnection\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/BubbleConnection/BubbleConnection.swift"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"02f7aece093ab162be10caac224f8d5e221a4b9007c7e63119419ede3108ebd4"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: UserDefaults (LCOM4 4): UserDefaults\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/Extensions/UserDefaults.swift"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3d88a72467229b66f877ea6d6c5c32aa14dbf11619678e96e0462f05040271e"}},{"ruleId":"D8","level":"error","message":{"text":"No automated tests: No automated tests \u2014 no test code was found in this repository. Untested code is the largest single risk to changing it safely. Start with the code you change most often: add a suite in a framework a runner can collect (XCTest or Swift Testing), and run it in CI so the gap cannot reopen."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3132564c6310e5d01a231f252a02d5d2f5a542c0a8fa29a14c89693f1e3df871"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: extract if secret \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/SensorConnector/SensorUtility.swift"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d8e0132e0bef6963b900532504e80ee9a3d7cd632d1df6c9fff9ef9b648d0de"}},{"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 \u0060GlucoseDirect.xcodeproj/project.pbxproj\u0060 makes this repository a deployable product (line 1)."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"GlucoseDirect.xcodeproj/project.pbxproj"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"239cb51a72402a6d8ae6dd8f40edc6c5ffaef3e44e203dad7cd03f3e8f1e0033"}},{"ruleId":"DM4","level":"error","message":{"text":"Anemic domain model: Data: \u0060Data\u0060 is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) \u2014 the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/Extensions/Data.swift"},"region":{"startLine":9}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c79c7820128f9dc47f3333a9be061e0579606ab57e0f52ecddc2d0aef1fcaf3"}},{"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":"M2","level":"note","message":{"text":"No architecture diagram/doc: No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named \u0060architecture\u0060 or \u0060design\u0060 in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape \u2014 no \u0060## Architecture\u0060 heading, no \u0022architecture overview\u0022/\u0022high-level design\u0022 phrasing, no \u0022the architecture is \u2026\u0022 introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document \u2014 not evidence that nobody wrote the shape down."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"0c190e7c159d1850ee706c3ac4486e151e8a4fe169de4bf61436b9f399654f06"}},{"ruleId":"P1","level":"warning","message":{"text":"No CI pipeline: No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, \u2026) \u2014 changes aren\u0027t gated by an automated build/test."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"44f01af96e50474fba2df84d95ddf4f7e1d34c29c307830b9efc9057daa6b670"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add CodeQL\u0027s Swift pack (Swift/Xcode) (or \u0060semgrep --config=auto\u0060, which runs on any language) \u2014 this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P6","level":"note","message":{"text":"No changelog: No CHANGELOG/HISTORY/RELEASES file \u2014 what shipped when isn\u0027t easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)"},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"dda5aa5aed8cbb292c3ef2b733bc138f614293ae6426c85e98bf31ef330d9415"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/DirectLog.swift"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"eba991f29cc20daa04cd88814d5bc0f9570a960985a517c28c308c961ba5c0d7"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/DirectLog.swift"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"508502fa7c14a6c807e1605ac78031b2ab1db42c34a87260e5c8e945ad4b133d"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/DirectLog.swift"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a0ef212c3ce6a040fc5db9e115eeec02f55dea9c22f799129601c63b12c2d34"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"Library/DirectLog.swift"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"0682ad1b723c68fcee978581c3967f86be116f89275f0a70c681d3e1c7578c9c"}},{"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":"Library/Content/Sensor.swift"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"f62bd14f301c45522e14e64d3d5ca67ae9fca5103676bdeee615b1f8ec908203"}},{"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":"Library/Content/Sensor.swift"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"54e4402860b2406ac42b9b42e0bb6a125ace0206ae54520235f490672b8e8660"}},{"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":"Library/Content/Sensor.swift"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"84d1414b4c0082464a9c6a2f674cec64fd2d013e8fe7e4796112cf56e20408d3"}},{"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":"Library/Content/Sensor.swift"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"b162b14faed02feeb5b2fbd3f5b9882bc19742f01197633fbe8980d3757fb9cd"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"App/Modules/DataStore/DataStore.swift"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a32d7b57e3fa87756ed4b142281db5d93eb698a33345f91a1b30e81f8cb5169"}}],"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-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-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-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":"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/"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":0,"secretScannerRunsExcluded":0}}}]}