{"$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":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D7","name":"Architectural Integrity","shortDescription":{"text":"Architectural Integrity"},"helpUri":"https://codehealth.canine.dev/dimensions/D7"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D31","name":"IaC \u0026 Container Security","shortDescription":{"text":"IaC \u0026 Container Security"},"helpUri":"https://codehealth.canine.dev/dimensions/D31","relationships":[{"target":{"id":"CWE-1032","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-16","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"]}},{"id":"D33","name":"JS/npm Dependency Vulnerabilities","shortDescription":{"text":"JS/npm Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D33","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"MarkdownRenderer.renderNode (cyclomatic 51): MarkdownRenderer.renderNode has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/renderer/markdown_renderer.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d6a3ef115a3bd882ef3da11ced10c6b9b33fd8260ce1aaf787e83edc064e5ea"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.parseUserAgent (cyclomatic 47): APIV1Service.parseUserAgent has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/auth_service_session.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9f8b1576117e216543c1576492182ec49246c6281c0d6baf6b6e640f07408aa"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateMemo (cyclomatic 34): APIV1Service.UpdateMemo 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":"server/router/api/v1/memo_service.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0c13082de87c90220a9f70f4b3b9a1c586957bfc07ae7517a087b9e9d77e9b9"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateUser (cyclomatic 32): APIV1Service.UpdateUser has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2cf13323513c37a08c2d313c4cafe82acd56659e1b78d1b395533205383ec3e"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.CreateAttachment (cyclomatic 31): APIV1Service.CreateAttachment has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c75fd2a99fcfbddec1ea737fc3d4ae29c6476ac15af741f8e00a9dc13272373"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateInstanceSetting (cyclomatic 29): APIV1Service.UpdateInstanceSetting has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"db4d3913e178e8fb29d1ac24b0ba293a4592f3f6d3b458a14db2d551b159614a"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.ListMemos (cyclomatic 29): APIV1Service.ListMemos has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"1afc959d4d9f7841df475021ccbe560b31b7c652325994a414c8e329ffd98c54"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemos (cyclomatic 28): DB.ListMemos has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"03351ca43bdc9fa1e47a6bddf81c1403b53930da2a5c8b66d9fea696fa3f325e"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemos (cyclomatic 28): DB.ListMemos has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/memo.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"7666c8777becd990d0dc45ff4fbcbc201d2832317033b05d7e6ac25c4d40acf5"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.ListMemoComments (cyclomatic 27): APIV1Service.ListMemoComments has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c66c3299176f41f84e332212a8993850b6fcbfa75c2e1ff245e4980f6ff853c"}},{"ruleId":"D1","level":"warning","message":{"text":"store.validateAndNormalizeDeploymentInstanceSetting (cyclomatic 27): store.validateAndNormalizeDeploymentInstanceSetting has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab4f054cc3721e05511591ad0c7e04c924145f1b0789718664bd2e84cb8f6355"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.characterReferenceLength (cyclomatic 26): parser.characterReferenceLength has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/parser/tag.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fb5d99bba74babf0bd42e533b3bb3c3442120d8dbd5b80976a0e4f9595dac28"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.CreateMemo (cyclomatic 26): APIV1Service.CreateMemo has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"91ccd336e25d03d557a13c70d818719410b48ab03630332322495b4507ac9030"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.ListAllUserStats (cyclomatic 26): APIV1Service.ListAllUserStats has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_stats.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"4528dfcf21cf0e47e5631f5290f205db6e5036eb60e32fb5a09e18a1a6fe35ae"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemos (cyclomatic 26): DB.ListMemos has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b776cabab81cd540b51f561386cd33226d51e6d2e0b6dc2454055062266c6d"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.scanTagSegment (cyclomatic 25): parser.scanTagSegment has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/parser/tag.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"350b2919ec1cd28e1a0232fc72dd188d99e5064207f94d36178c22d11c81d573"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListAttachments (cyclomatic 25): DB.ListAttachments has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/attachment.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"a30231f07fd7738d768c61ed32bcafc5c350e641450ec67e2c4f0a2b3e0b121c"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListAttachments (cyclomatic 25): DB.ListAttachments has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/attachment.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"144d1148efc41ce3ea89481b824cfbe329d9c8bc6e81c58a4afce27a96cb6aa4"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateUserWebhook (cyclomatic 24): APIV1Service.UpdateUserWebhook has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_webhooks.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a73c0735de1dad788d1fa7468c2c21d7e4a2011c79cc304df0e00b7d24a4f46"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListAttachments (cyclomatic 24): DB.ListAttachments has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/attachment.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"9226af6730642a0980728f7366034ce47e38609ae326c862d2a86448bc80d586"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.normalizeMemoAttachmentRequest (cyclomatic 23): APIV1Service.normalizeMemoAttachmentRequest 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":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"f89957654cd28ee14f233722a74711c5762627a1160d9c2ff945427a05a9ed1f"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateUserSetting (cyclomatic 23): APIV1Service.UpdateUserSetting 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":"server/router/api/v1/user_service_settings.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"19fd9e599b30dd43f1cb8f4a98d31d84f3738641815d50d573e7f2513a0c256a"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemoRelations (cyclomatic 23): DB.ListMemoRelations 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":"store/db/postgres/memo_relation.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"b62ac2d37fd73e6d90b2891eec5fd933129cecc17df6640e2e66c24b46416114"}},{"ruleId":"D1","level":"warning","message":{"text":"filter.evaluateNumeric (cyclomatic 22): filter.evaluateNumeric has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"4592a63342a3cc47157ad25a0c20d2fd1d6608bf3bf608d6aa6163a2b07124ae"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.getInstanceSettingByName (cyclomatic 22): APIV1Service.getInstanceSettingByName 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":"server/router/api/v1/instance_service.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"97f271e5008d5e57c618852d9b1f9411883c4fc8772b91b04e0c56a726df2c76"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.prepareInstanceAISettingForUpdate (cyclomatic 22): APIV1Service.prepareInstanceAISettingForUpdate 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":"server/router/api/v1/instance_service_validation.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa710800956902c291ca9a56951cb227692ed0a04740d7d13515d0a9fcf6b636"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.CreateMemoComment (cyclomatic 22): APIV1Service.CreateMemoComment has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"e28dc8b950485a318f29b9ff86515d001a2f8be2ae5b985132dd7a0dd9df3257"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.batchConvertMemoRelations (cyclomatic 22): APIV1Service.batchConvertMemoRelations 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":"server/router/api/v1/memo_service_converter.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"67fa74ecdc4416c614c187b19a12b43f21caa629d893b0c17f1c4dbe084e8936"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.CreateUser (cyclomatic 22): APIV1Service.CreateUser 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":"server/router/api/v1/user_service.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"3de7b234f965ed301a9cd85f9daec32e29a071e059cf9fde267d38c8f23e3805"}},{"ruleId":"D1","level":"warning","message":{"text":"RSSService.generateRSSFromMemoList (cyclomatic 22): RSSService.generateRSSFromMemoList 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":"server/router/rss/rss.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"38c4996658b946bce271a5082feefdf86cdff024d6d53b284ec2132cf8e287f8"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListUsers (cyclomatic 22): DB.ListUsers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"075cf0732a37dad869db4bddb493193e5c50e77b6441c8018b87bbdecc86184e"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListUsers (cyclomatic 22): DB.ListUsers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/user.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3e3f767338ebff11e2822bba8cf55b7d31db54bb28fe08bae5a37fa8e69bbfe"}},{"ruleId":"D1","level":"warning","message":{"text":"filter.buildCallCondition (cyclomatic 21): filter.buildCallCondition has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"9681203d4a443d43dc6900753cfb154668cbb365336cf6c4df6840ffa4760bb0"}},{"ruleId":"D1","level":"warning","message":{"text":"scheduler.parseField (cyclomatic 21): scheduler.parseField has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/scheduler/parser.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"39dfecd298db7a2e98b1733bbe6cfdfefebd4ef92a34de10964491ef075d4602"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemoRelations (cyclomatic 21): DB.ListMemoRelations has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"3da75c268945643b0696623a5be697748c798f8e2956f30562e89752dc27d896"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListMemoRelations (cyclomatic 21): DB.ListMemoRelations has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/memo_relation.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fda84a295ec32505ad46e300e214008627f8a8d7ddb05e0e7b42f5ce1224e3b"}},{"ruleId":"D1","level":"warning","message":{"text":"filter.compareLiterals (cyclomatic 20): filter.compareLiterals has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"67b4649a8d8971c931dea9bbc9682df29110793a8da42b2e1c3073c47607234f"}},{"ruleId":"D1","level":"warning","message":{"text":"service.GenerateSnippet (cyclomatic 20): service.GenerateSnippet has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 304). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/markdown.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"0210f5d5b99905065e4b56ce0dc1fa9dde8be3e3fbc683a16856ee13c8fae4d4"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServerService.checkAttachmentPermission (cyclomatic 20): FileServerService.checkAttachmentPermission has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/fileserver/fileserver.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb0005546a7290c96409aa0d94665e2105f0204167ba4b0ab48dba20ebe6e888"}},{"ruleId":"D1","level":"warning","message":{"text":"store.validateDeploymentIdentityProvider (cyclomatic 20): store.validateDeploymentIdentityProvider has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cb89e559cf4e0eb8c7676b89ffb4edd202959bae368e3ce54d8a2167a5c087d"}},{"ruleId":"D1","level":"warning","message":{"text":"DB.ListUsers (cyclomatic 20): DB.ListUsers has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"bedd233be255c155af72bdda1e6d573b65c6a75bb88e4a5273d027022e98f870"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateIdentityProvider (cyclomatic 19): APIV1Service.UpdateIdentityProvider 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":"server/router/api/v1/idp_service.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5606eb33fe8bd5a746de7d7c43eaf2bec58287716bb7719b8a0d355d6813ead"}},{"ruleId":"D1","level":"warning","message":{"text":"filter.buildValueExpr (cyclomatic 18): filter.buildValueExpr has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"d498329a21defd0edbf7d0eedebd69fb2c1dec29e94a0484f728110f70fec4a9"}},{"ruleId":"D1","level":"warning","message":{"text":"v1.handleSSE (cyclomatic 18): v1.handleSSE has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/sse_handler.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"72a5cf0a5265baf3112a89e0b1e786d28fe493d0caf06d8a3f8495fd35f7fb48"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.Transcribe (cyclomatic 18): APIV1Service.Transcribe has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/ai_service.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e775d3da8b6c76bbea782e8d25d3aec002b5d339c330d8bcf8365fa509c8942"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.UpdateShortcut (cyclomatic 18): APIV1Service.UpdateShortcut has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/shortcut_service.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a003539e08b81f2873e1f5c05d77e246d88d9dc9b704fd893303b93711be9d0"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.validateAuthenticationMutationState (cyclomatic 18): Store.validateAuthenticationMutationState has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/auth_config.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"3647368e94716dc74afabaea86825497707776c72ea1bbec08934cbca899b7ed"}},{"ruleId":"D1","level":"warning","message":{"text":"audio.WebMOpusToWAV (cyclomatic 17): audio.WebMOpusToWAV has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/ai/audio/webm.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"2be195ad371900b8f54c1459e7502148e5573d19e895857891bb5129aaa5c41c"}},{"ruleId":"D1","level":"warning","message":{"text":"IdentityProvider.UserInfo (cyclomatic 17): IdentityProvider.UserInfo has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/idp/oauth2/oauth2.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"90222af66beb8d27e3dae408bd5d2931afc12e15b27db37ae84bb99d652295e3"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.GetUserStats (cyclomatic 17): APIV1Service.GetUserStats 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":"server/router/api/v1/user_service_stats.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c1d53fc5158e352d7434b675f136bd23b5177fa2cc3337dd7387113e422b83a"}},{"ruleId":"D1","level":"warning","message":{"text":"store.normalizeDeploymentAISetting (cyclomatic 17): store.normalizeDeploymentAISetting 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":"store/deployment_config.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcc3a273da030aca2a1f3be9adb2dcc760dc082d99ff40fabd48af61ce124b36"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.deleteAttachmentStorageImpl (cyclomatic 17): Store.deleteAttachmentStorageImpl has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 225, 211). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/attachment.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e67f28235fd3d1f0dcdf07ea9ec3e4366c50e2da9bfa7cdb37f15eace3928de"}},{"ruleId":"D1","level":"warning","message":{"text":"service.ExtractAll (cyclomatic 16): service.ExtractAll has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 412). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/markdown.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5029925dc272f84e96c333d248933cf25d8816a7e19c19526763cbe07c0f6af"}},{"ruleId":"D1","level":"warning","message":{"text":"EmailDispatcher.DispatchInboxEmail (cyclomatic 16): EmailDispatcher.DispatchInboxEmail has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/notification/email.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"d92c55eff4b2dd996627020bf8f20f34223550e1372c1e0e829494eaa37cc43a"}},{"ruleId":"D1","level":"warning","message":{"text":"v1.SaveAttachmentBlob (cyclomatic 16): v1.SaveAttachmentBlob 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":"server/router/api/v1/attachment_service_storage.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5addc43fb867ca2e203cede8fbd4fb3e230bda6f5d67e1c235ba81d8af8e5fb"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.DeleteMemo (cyclomatic 16): APIV1Service.DeleteMemo has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1638f3fed0d0973f9b7d5f177bd81afe8956ce9afc28c42e96f318a7c7c4684"}},{"ruleId":"D1","level":"warning","message":{"text":"APIV1Service.DeleteUser (cyclomatic 16): APIV1Service.DeleteUser 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":"server/router/api/v1/user_service.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"3913cdb97b6d4c34445cb30d259d4372d700cfbe122d77f20605a6b52a2530bf"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.LoadDeploymentConfigurationDir (cyclomatic 16): Store.LoadDeploymentConfigurationDir 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":"store/deployment_config.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"76c4c638cf0fa32b9f570aedc455fc2e3f181194a85ce76ec2938cec50bfffb3"}},{"ruleId":"D1","level":"warning","message":{"text":"Store.validateDeploymentAuthenticationState (cyclomatic 16): Store.validateDeploymentAuthenticationState 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":"store/deployment_config.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"5320e20ec53e348752525bedea717926aff65eb090605c44fd57b8829e31d9ff"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.parseUserAgent (cognitive 80): APIV1Service.parseUserAgent has cognitive complexity 80 (threshold 15). Drivers by points: if/else 74, boolean chains 6 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/auth_service_session.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c5a27f7daf88b5876ed8b953ebeb1b47fbfda0390febd51b7c65f1696b53fa1"}},{"ruleId":"D2","level":"warning","message":{"text":"MarkdownRenderer.renderNode (cognitive 62): MarkdownRenderer.renderNode has cognitive complexity 62 (threshold 15). Drivers by points: if/else 58, boolean chains 3, match/switch 1 (nesting depth added 30). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/renderer/markdown_renderer.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"d652bc566540630eeec1c0454b7603c7c2a4e26e00af46fff508a7eb78738d19"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.ListAllUserStats (cognitive 59): APIV1Service.ListAllUserStats has cognitive complexity 59 (threshold 15). Drivers by points: if/else 52, loops 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_stats.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fd77dc56e72cc78287ed98c79668fd6d9be29a527188b3450ad70109d6fa4e6"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateMemo (cognitive 54): APIV1Service.UpdateMemo has cognitive complexity 54 (threshold 15). Drivers by points: if/else 51, boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"0176e619f53c78c942588be70bb9fbef6bfa36d946d8170300ab1c73fe2dd9eb"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateUser (cognitive 48): APIV1Service.UpdateUser has cognitive complexity 48 (threshold 15). Drivers by points: if/else 43, boolean chains 2, match/switch 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"1969d9cbb8c89455c8ed65bba3d35e20139b59eb568cb56c2c38138df5f155fb"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.CreateUser (cognitive 43): APIV1Service.CreateUser has cognitive complexity 43 (threshold 15). Drivers by points: if/else 41, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cce69a1826709ed9d1d0818a9dab7fbea36c0596d472b8a0b261294620edb1c"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.GetUserStats (cognitive 42): APIV1Service.GetUserStats has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39, loops 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_stats.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"72277017d0befae41b13e96424e4810f0e4f34ada984b7b673f7c17de190507e"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateUserWebhook (cognitive 42): APIV1Service.UpdateUserWebhook has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, loops 3, match/switch 3, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_webhooks.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ea8d565f9236ad53ca922bf862c6200b42748d9c1b6f6c25320b56f6f9360bf"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.ListMemos (cognitive 41): APIV1Service.ListMemos has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, loops 6 (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":"server/router/api/v1/memo_service.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7379c44935f9f2e33ce57c37e068238aaa98a77da170d72656f244b6c150d5d"}},{"ruleId":"D2","level":"warning","message":{"text":"store.validateAndNormalizeDeploymentInstanceSetting (cognitive 41): store.validateAndNormalizeDeploymentInstanceSetting has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, boolean chains 4, loops 3, match/switch 1 (nesting depth added 21). 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":"store/deployment_config.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe165390c1ef9d8da4a416c92963f09a172a784a1c5a5b5d4796ebce1f525ba1"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.CreateAttachment (cognitive 40): APIV1Service.CreateAttachment has cognitive complexity 40 (threshold 15). Drivers by points: if/else 38, boolean chains 2 (nesting depth added 9). 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":"server/router/api/v1/attachment_service.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"9df7bd361eb0b0aa9cfb8b5780aaa50b164c97487352a438c2b3482c6f1b34bd"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.normalizeMemoAttachmentRequest (cognitive 37): APIV1Service.normalizeMemoAttachmentRequest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 5 (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":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8f7d2c1a7d909bc87e621dece81be1beb16f8c774b8b9eb22539081cc2fed37"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemos (cognitive 37): DB.ListMemos has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 11 (nesting depth added 9). 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":"store/db/mysql/memo.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6a48c60868d785aa85080fd2ca03cae72f5a97201ed0dbae2cac78aafe609ab"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemos (cognitive 37): DB.ListMemos has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 11 (nesting depth added 9). 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":"store/db/sqlite/memo.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba86e2dac40b228364e6dcc6ba1fe7fedf5e23dcd3dc5a0a814976c483b3f6c2"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.batchConvertMemoRelations (cognitive 36): APIV1Service.batchConvertMemoRelations has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 8, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service_converter.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ee96c54f685c4100addc14290e1092c6dc8e1cb383453e6bd61179166e751fe"}},{"ruleId":"D2","level":"warning","message":{"text":"RSSService.generateRSSFromMemoList (cognitive 36): RSSService.generateRSSFromMemoList has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 7, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/rss/rss.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"085075b94a23ea6c58bb780c4b4afeddc41c9b8606266dd929276772e3b77a39"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.prepareInstanceAISettingForUpdate (cognitive 35): APIV1Service.prepareInstanceAISettingForUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 4, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service_validation.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc99aabbe15d75c35ddf54e56e6e03a28ccdf356f4370c1d23616d1194f59a0c"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemoRelations (cognitive 35): DB.ListMemoRelations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 9 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo_relation.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"374f61a2e1268ef79d4abaa28f500e073ee5ff565a1fc8bd39d0b2038fb7f0f3"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateInstanceSetting (cognitive 34): APIV1Service.UpdateInstanceSetting has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, boolean chains 5, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e05dcccfa1a7fe73d22928db599b0de764f18a8de124ed796a2f64c7271885d"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.ListMemoComments (cognitive 33): APIV1Service.ListMemoComments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7a4841cceb01ecd8c56b2aa8cb14c36dd6e54143d11d40281aa09d86e47b674"}},{"ruleId":"D2","level":"warning","message":{"text":"Runner.CheckAndPresign (cognitive 33): Runner.CheckAndPresign has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, loops 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/runner/s3presign/runner.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"a327dd3d906a4d9b5ef3481abb7f94fc0be24130fa9de8ed2170761dd042d241"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListAttachments (cognitive 33): DB.ListAttachments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 5 (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":"store/db/mysql/attachment.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"f20f08e24cb6398507ee2383c730b9e1447bd402aad7aff1cdd6846572aef438"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemos (cognitive 33): DB.ListMemos has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 7 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c2ce05f45990a7f8bb1f5d047c058f9f72ea0330924448f05aef1f6d09765da"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListAttachments (cognitive 33): DB.ListAttachments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 5 (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":"store/db/sqlite/attachment.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ef1db08f95330009d7011c2a1b12560f6f34c6db295070311c9a58425c9e98"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateShortcut (cognitive 31): APIV1Service.UpdateShortcut has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 4, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/shortcut_service.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"b53edffb369b0f28091fccb94a687eb8be6c2eb9b88606a87badcbb9034c8e3d"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListAttachments (cognitive 31): DB.ListAttachments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/attachment.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"606e88e168151d93a183b183fa1fbe78244532a3fdb26ad3c052e5bc2375180a"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.deleteAttachmentStorageImpl (cognitive 31): Store.deleteAttachmentStorageImpl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 30, boolean chains 1 (nesting depth added 15). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 225, 211). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/attachment.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"da756d6654de9cbbc9c005bbbc26b11f77a84d9b1176c3e18d8f086d3db85455"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateUserSetting (cognitive 30): APIV1Service.UpdateUserSetting has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, match/switch 7, loops 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_settings.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d101df28ba06675de12d8dbb173ebab40816c35e7036b27a7eb9a8cf1b1fe4b"}},{"ruleId":"D2","level":"warning","message":{"text":"httpgetter.extractHTMLMeta (cognitive 29): httpgetter.extractHTMLMeta has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/httpgetter/html_meta.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cda39196c4d466e80103960fd5d36832261e099df90eaf8f09192dc76ec4263"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemoRelations (cognitive 29): DB.ListMemoRelations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 9 (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":"store/db/mysql/memo_relation.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae2b4066e1c81700447880d77f33c83789068c301d940e53b274627236155dc2"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListMemoRelations (cognitive 29): DB.ListMemoRelations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 9 (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":"store/db/sqlite/memo_relation.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1b1519ef0cd50dfcd30a42159ae7c10f0ea5652491bf9a3986da84ee7584011"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.LoadDeploymentConfigurationDir (cognitive 29): Store.LoadDeploymentConfigurationDir has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c0e5dcca1dbf992e1328243c12c3c6a271efcc40623f7b4bc11a301baa0e8ea"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.buildValueExpr (cognitive 28): filter.buildValueExpr has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, match/switch 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"589d338f68e0e213ef72035eaa77487dacd08ef70b37b5a266e1ca88a746affb"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.scanTagSegment (cognitive 28): parser.scanTagSegment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13, boolean chains 8, match/switch 4, loops 2, jumps 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/parser/tag.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"522c9ff198a67e135a52f44d5365e52e17cd4c5d760f907c5d05f7448ffc0996"}},{"ruleId":"D2","level":"warning","message":{"text":"v1.SaveAttachmentBlob (cognitive 28): v1.SaveAttachmentBlob has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service_storage.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7c7f2778efd73d32931b062b6b2905dfc9240c763088b4f601d82a43b71a88a"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.CreateMemo (cognitive 28): APIV1Service.CreateMemo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bc570c455aa579df1982de5fd6537ba2e79c37087c295872925b48618acc9e2"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.bindSSOIdentityToUser (cognitive 27): APIV1Service.bindSSOIdentityToUser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 27 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/auth_service_sso.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"87b107c0f6e1fb2069718c73d5e3d9e64e35ab69d9bb56601959852a1e4fce4e"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListUsers (cognitive 27): DB.ListUsers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 1 (nesting depth added 6). Of this number, 23 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0540f0cdeac8e63f4b0ba26b96d2150d909cb0382f2c8a9e28838b387ed095d"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListUsers (cognitive 27): DB.ListUsers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 1 (nesting depth added 6). Of this number, 23 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/user.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"8baad994dacb7f167c3ddb55a3062e5c7b45679f0fb9a572ec0861952f68dde9"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.evaluateNumeric (cognitive 26): filter.evaluateNumeric has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2312e377aa3a771c431a3c4ccea17dc582e9bdaf0ef7bc297967ff6ec5031ee"}},{"ruleId":"D2","level":"warning","message":{"text":"renderer.renderJSONBoolComparison (cognitive 26): renderer.renderJSONBoolComparison has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/render.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"704743e68fd76d8384fab6fbcd0e382a692ae5c78e42c6a9a9fa6be029af1fa7"}},{"ruleId":"D2","level":"warning","message":{"text":"v1.handleSSE (cognitive 26): v1.handleSSE has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/sse_handler.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"367acc9aaa86ed08f0bd7463ef7055311458c801ed368bcb4c274bf3a6e8501b"}},{"ruleId":"D2","level":"warning","message":{"text":"store.normalizeDeploymentAISetting (cognitive 25): store.normalizeDeploymentAISetting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"10d1f598f29afd18e61082d5e82f6abc1e74619475d4d45bab7947c71557c5be"}},{"ruleId":"D2","level":"warning","message":{"text":"audio.WebMOpusToWAV (cognitive 24): audio.WebMOpusToWAV has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 6, boolean chains 2 (nesting depth added 8). Of this number, 18 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/ai/audio/webm.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d3d0b2cf73700fde29840f22d17a601ed7be1bf87a6a1bd37e48f3af354275d"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.buildComparisonCondition (cognitive 23): filter.buildComparisonCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fa4737592be45e38f122c78c0cb428e30efaaeed9554f40a9be5f82d17a151a"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.buildInCondition (cognitive 23): filter.buildInCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"70ae54365a35bf9a97b618ce0995982e346d3468c8a2e2f38204f735ad8ae168"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.characterReferenceLength (cognitive 23): parser.characterReferenceLength has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 8, loops 3 (nesting depth added 3). Of this number, 18 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/parser/tag.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"d816b69cebb775b000048b8c122c63b519d02037f755d618672ec236520fc48f"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.GetAttachmentBlob (cognitive 23): APIV1Service.GetAttachmentBlob has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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":"server/router/api/v1/attachment_service_storage.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"132029ac4ea6815ca33987367d06fc9b3239949d23f5192f8b51f5c87e6a4e8b"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListUsers (cognitive 23): DB.ListUsers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 5, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a64a484a57cbbd30f22a617e777501e67e6a379079b177251682afeb029c541"}},{"ruleId":"D2","level":"warning","message":{"text":"service.GenerateSnippet (cognitive 22): service.GenerateSnippet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, match/switch 7, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 304). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/markdown.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"61a7a61d73b547818b071db253e99e4ff5bc79099710641fb0e5c73fcfe75bb1"}},{"ruleId":"D2","level":"warning","message":{"text":"Profile.Validate (cognitive 22): Profile.Validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/profile/profile.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2b8034190bb6a5bb508f1bc12d3d0d63a64042b6a8b6d1409be988c78c531ce"}},{"ruleId":"D2","level":"warning","message":{"text":"store.validateDeploymentIdentityProvider (cognitive 22): store.validateDeploymentIdentityProvider has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9ac3964d04aabf32df8e04c8584bc93c6b79318fff53e1e05570ca5fa68105e"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.buildCallCondition (cognitive 21): filter.buildCallCondition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"a260ddcd0cf37f63e007423d4eff6e9cc7c3699ead6935cb46a774f8aca5f470"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.getInstanceSettingByName (cognitive 21): APIV1Service.getInstanceSettingByName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"8948e5f929e72d0686946997aa763d98c88964885c1e6fed5cbfa3fb6865a7e3"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.CreateMemoComment (cognitive 21): APIV1Service.CreateMemoComment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"82b65279e5ce5d7d751a533ef0c2e15b3a07ace5855aaf0ea9d36cd08f263ac1"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.DeleteUser (cognitive 21): APIV1Service.DeleteUser has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"a78e28480deb31083730680f15e04b76a23a5fe54fe7fcd2760dbd4d732dcd82"}},{"ruleId":"D2","level":"warning","message":{"text":"IdentityProvider.UserInfo (cognitive 20): IdentityProvider.UserInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/idp/oauth2/oauth2.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5d5f9fc2e70a1fcda5af0a6d70423fe3ca4cd21d3ebb5acf96eaf4234fe9fb0"}},{"ruleId":"D2","level":"warning","message":{"text":"scheduler.parseField (cognitive 20): scheduler.parseField has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/scheduler/parser.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9aed7ab1d84ca38603041a4546e968f273d71070f6de6394a81d6f04d9af06f"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.SignIn (cognitive 20): APIV1Service.SignIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/auth_service.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb852196d882856e575a05d086d54f95cc8e79e0e078f3902aaa33f9ec3cdff4"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateIdentityProvider (cognitive 20): APIV1Service.UpdateIdentityProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/idp_service.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"b36f7429044ea38786bb637f46dedcee29e48ad929736f8d0e8a8876fec40564"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.parseMemoOrderBy (cognitive 20): APIV1Service.parseMemoOrderBy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service_query.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"b32f8390321ca9beba4c11254e39692904be14bff4459a42f9b0f94549772fd7"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServerService.checkAttachmentPermission (cognitive 20): FileServerService.checkAttachmentPermission has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/fileserver/fileserver.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"682ef36c9bdfd7324f7a92841f559da4c51d9bc21559b9bcf3dcce6626469a6d"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.validateAuthenticationMutationState (cognitive 20): Store.validateAuthenticationMutationState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 5, boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/auth_config.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d3cf317c98eb5ec7b36262285ed36e21f4cd3cc056f2a0739ac1e0aa66a4721"}},{"ruleId":"D2","level":"warning","message":{"text":"v1.canonicalGatewayPattern (cognitive 19): v1.canonicalGatewayPattern has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/gateway_route_resolver.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"d796f5ba96c4d0a67c8ef02aa26dda4ac838fe17f1152744719c209d79a7f3c3"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.BatchDeleteAttachments (cognitive 19): APIV1Service.BatchDeleteAttachments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"16b22a559101cf464b452881b74d3e3b26a886df5ec354074a7b3084b58b340f"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.buildAPIRequest (cognitive 19): mcp.buildAPIRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/mcp/adapter.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea853c0c5995e83465ce1de44a8844edb75f9d77101d780e6b671a41c5ac977a"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.validateDeploymentAuthenticationState (cognitive 19): Store.validateDeploymentAuthenticationState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/deployment_config.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"187c71dd16de6bb7e84119e068bd0f926a3f39582d15deae427d90645fa7dc19"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.applyMigrations (cognitive 19): Store.applyMigrations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/migrator.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"d42b21b27970aade3c7db7955f3a7730fd2735b764067e798d765060bada11b3"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.convertInboxToUserNotificationWithUsersAndMemos (cognitive 18): APIV1Service.convertInboxToUserNotificationWithUsersAndMemos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_notifications.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c4f2cf954fb4ec6651c24fda5d63807f56b11f7a1ecfca1ab7e91b8882aa5c"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListInboxes (cognitive 18): DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/inbox.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"66d14ffc85f1eb740b105af7441ccb9d9c060f572ccb8ee00d3ede228bbe2044"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListInboxes (cognitive 18): DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/inbox.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"48c13f6f564f269d85dfef3e3affcd274b2377167490847e032e93d067f85bf5"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListInboxes (cognitive 18): DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/inbox.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"b340bcdb599bf5bff57bdafcebc57fb392cdf55c74b58208bd6e8ce393db3d40"}},{"ruleId":"D2","level":"warning","message":{"text":"Store.DeleteAttachments (cognitive 18): Store.DeleteAttachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/attachment.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"22a38f4a41272862f0e79d99b3788a5581b41499bbc39c8ed5d2da6fc2ac3591"}},{"ruleId":"D2","level":"warning","message":{"text":"filter.buildSetCondition (cognitive 17): filter.buildSetCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4dd122a7e045f9ff4d3d33f6cd934b437026c0accc907b60003eff819db2ed7"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.Transcribe (cognitive 17): APIV1Service.Transcribe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/ai_service.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"89e85778f8c67de92d0432aae07a9b18e7a4058240ff2efb0b3935d2ec560e58"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.GetMemo (cognitive 17): APIV1Service.GetMemo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"647edfca4969ef12ef46481263fb4bd05d33c66bec232fc7e2ad46b902c619d5"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.DeleteMemo (cognitive 17): APIV1Service.DeleteMemo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"1af4f25a2a6c284384c7eb1cfd5e73c094fd140bf63eacacc696606ff93706a4"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.ListUsers (cognitive 17): APIV1Service.ListUsers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"7249980eceb8f44c55cdbda79d6f3bd7d8f1472e2bfc88039572b07507125052"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.validateObjectSchema (cognitive 17): mcp.validateObjectSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/mcp/validation.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"a79b215791dcdca1a60448a3e7a6d014047693115d38173c69e7a73627306df3"}},{"ruleId":"D2","level":"warning","message":{"text":"mysql.listDeleteUserMemoTreeIterative (cognitive 17): mysql.listDeleteUserMemoTreeIterative has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 7 (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":"store/db/mysql/user_delete.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d1e8f8f012bfe59f5a4fb30f2de07a52bf6ab8d7f6f3367d37b6ae46979c38b"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ApplyAuthenticationConfigMutation (cognitive 17): DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/auth_config.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0f09db5320ff9f6a0ebf7c1a7a5fa225e9340f5644370f988731ea4d86133b4"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ApplyAuthenticationConfigMutation (cognitive 17): DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/auth_config.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"5081598265f229319fd7b1d1e7540952a3afb76ce3aecf7d9f7e3c96308fb73d"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ApplyAuthenticationConfigMutation (cognitive 17): DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/auth_config.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca43fc214d380e9e90d76f60c750346e0b91ec9e27ae2efa7a188fcad849cb9f"}},{"ruleId":"D2","level":"warning","message":{"text":"email.init (cognitive 16): email.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 18). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/email/email.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6bfd467145b7f126295b6c32f6adc4aef81ac8601bc9bcdad23048fc7a79ad8"}},{"ruleId":"D2","level":"warning","message":{"text":"extensions.replaceUnparsedGFMURLs (cognitive 16): extensions.replaceUnparsedGFMURLs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/extensions/gfm.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"c999a521063a5a7de701a2c408073e4fe497385b75a64872f3731a1633a53290"}},{"ruleId":"D2","level":"warning","message":{"text":"service.ExtractAll (cognitive 16): service.ExtractAll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 412). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/markdown.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"70eb6b8b56bb150cf451a0b69b7c2dbb069be38c05b6c82cabfb47f00d56bffb"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateAttachment (cognitive 16): APIV1Service.UpdateAttachment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc1b8c028a7ef76da6e2bbfd1572ab153c6a11097aa6d80c5019ddab1edfda97"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.setMemoAttachmentsInternal (cognitive 16): APIV1Service.setMemoAttachmentsInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"d445521685fb3a2bebf4620acdad99b8206510b1cfca5cff83909b2a7a0f1a26"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.ListUserNotifications (cognitive 16): APIV1Service.ListUserNotifications has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_notifications.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"d175654213236ceb2a8c54de6524ef9fdae2519f90ed2bc7cc016e330654941c"}},{"ruleId":"D2","level":"warning","message":{"text":"APIV1Service.UpdateUserNotification (cognitive 16): APIV1Service.UpdateUserNotification has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, match/switch 5, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_notifications.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4a3fc23da9547c1d1e2536d8f695364af754882e2168e752402510d34e74c94"}},{"ruleId":"D2","level":"warning","message":{"text":"mcp.buildOperationRegistry (cognitive 16): mcp.buildOperationRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/mcp/openapi.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"2175a2ab90ec6d125e613edcb1b0fff752411be0b676fc7134f3a77d9f477261"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.ListReactions (cognitive 16): DB.ListReactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/reaction.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"c00876a4910a97063883d2d98a060c8ba6e709583fe98082914331a4e408f867"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): store/db/postgres/user_delete.go:134-156 | store/db/sqlite/user_delete.go:134-156 \u2014 \u0060store/db/postgres/user_delete.go\u0060 and \u0060store/db/sqlite/user_delete.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 16 separate duplicated blocks between them, totalling at least 199 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/user_delete.go:134\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user_delete.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"84a9c01021f3dcdf4bf49b6c6d70346f7aca8177852dfe19e9ada49483de754c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 3): store/db/mysql/user_delete.go:219-239 | store/db/postgres/user_delete.go:182-202 | store/db/sqlite/user_delete.go:182-202 \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 \u0060store/db/mysql/user_delete.go:219\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c19688b2c1834085d59e78809982cd8b62e7779347f066f7121fa05f72458c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 3): store/db/mysql/user_identity.go:117-136 | store/db/postgres/user_identity.go:95-114 | store/db/sqlite/user_identity.go:95-114 \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 \u0060store/db/mysql/user_identity.go:117\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_identity.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"d04c4c368d2a10c6fa616cc323e7c30645d6a9a6b213744607d404327ba29abb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 3): store/db/mysql/memo_share.go:60-79 | store/db/postgres/memo_share.go:47-66 | store/db/sqlite/memo_share.go:49-68 \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 \u0060store/db/mysql/memo_share.go:60\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_share.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"81fa2e345a364a942ed54beebdd70455b90605802eda98e59e5db27d2b446472"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): store/db/postgres/idp.go:32-50 | store/db/sqlite/idp.go:35-53 \u2014 \u0060store/db/postgres/idp.go\u0060 and \u0060store/db/sqlite/idp.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/idp.go:32\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/idp.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"9169ac33b3779858a9e9f2e83806074638b86231547ca6a7a1fe09d464ddb02f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): store/db/postgres/memo_share.go:103-121 | store/db/sqlite/memo_share.go:105-123 \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 \u0060store/db/postgres/memo_share.go:103\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo_share.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c73283789b7418a76a99148a861e89363b5ad8aefd6953e84d67f4f57a94eba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): store/db/postgres/reaction.go:46-64 | store/db/sqlite/reaction.go:53-71 \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 \u0060store/db/postgres/reaction.go: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. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/reaction.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"f99ba7dd84855111f86db60a5a988fbe22f85c8e544a039f225eacea602f24b4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): store/db/postgres/user_identity.go:22-37 | store/db/sqlite/user_identity.go:22-37 \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 \u0060store/db/postgres/user_identity.go:22\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user_identity.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dd09834e2ad209009c4f471c60d5e604a1fdf6f5a7d8afad63320f86e1163c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): store/db/postgres/instance_setting.go:34-49 | store/db/sqlite/instance_setting.go:34-49 \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 \u0060store/db/postgres/instance_setting.go:34\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/instance_setting.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"8aa9bc013afa794fb7628528fa6bb09715779446c7a15c8938ee3b175335b3c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): store/db/postgres/memo_relation.go:24-39 | store/db/sqlite/memo_relation.go:24-39 \u2014 \u0060store/db/postgres/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/memo_relation.go:24\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo_relation.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc3592a103dcee927bb761e36e0c427aac7ddf777cfe6dd471eecf6441aefea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): store/db/mysql/instance_setting.go:45-59 | store/db/postgres/instance_setting.go:52-66 | store/db/sqlite/instance_setting.go:52-66 \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 \u0060store/db/mysql/instance_setting.go:45\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/instance_setting.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"02568ff21a2f88b7882b72dd5fd9c298baf1ed841c2e95adb5aa9b2f36ff22c3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): store/db/mysql/memo_relation.go:110-124 | store/db/postgres/memo_relation.go:137-151 | store/db/sqlite/memo_relation.go:121-135 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:110\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2502baf61e71af1e9bc9dd6874136b7dd17f82f8dcf9e410a79d533734a7185"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): store/db/mysql/reaction.go:80-94 | store/db/postgres/reaction.go:68-82 | store/db/sqlite/reaction.go:75-89 \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 \u0060store/db/mysql/reaction.go:80\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/reaction.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"14669f775bdf9c23dfff21dee7d205e84d4f47c3791590c384c4f33e3f1fdf19"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): store/db/mysql/user.go:166-180 | store/db/postgres/user.go:170-184 | store/db/sqlite/user.go:179-193 \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 \u0060store/db/mysql/user.go:166\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4b67280e2ed1e3f83474f648547948c750c72f916bf4ddd5afdfdd8284f02c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): internal/filter/parser.go:199-213 | internal/filter/parser.go:216-230 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/filter/parser.go:199\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0d6ad3489dcf3869b3265a395c10af8e55f6c83e8c9de2dbd55b282d22103fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): server/router/api/v1/attachment_service.go:399-413 | server/router/api/v1/shortcut_service.go:342-356 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/attachment_service.go:399\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"7894ef99653cdcbf2922f387afa0960cd05ed82455726db452750fa3d40a7f54"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): store/db/mysql/attachment.go:245-259 | store/db/sqlite/attachment.go:225-239 \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 \u0060store/db/mysql/attachment.go:245\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/attachment.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"5828691adc9aa8468debe4c36b7b996ecba637c397d846572ffe766125b6c247"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): store/db/postgres/user_setting.go:38-52 | store/db/sqlite/user_setting.go:38-52 \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 \u0060store/db/postgres/user_setting.go:38\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user_setting.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"10f7debefb323efd0244722c98f398175046e4260587c3e81290befb2878821b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): store/db/mysql/user_delete.go:358-371 | store/db/postgres/user_delete.go:321-334 | store/db/sqlite/user_delete.go:321-334 \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 \u0060store/db/mysql/user_delete.go:358\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":"store/db/mysql/user_delete.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e4ceb20fe924033b54d7466d7afd14dfa39f3b65c6eaf914a8f24da94d36c33"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): store/db/mysql/attachment.go:140-153 | store/db/postgres/attachment.go:133-146 | store/db/sqlite/attachment.go:133-146 \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 \u0060store/db/mysql/attachment.go:140\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/attachment.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba0fd08938732a69865d80241b89a2ac0b6e4758f28b01373e4d37aef826f18c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): store/db/mysql/idp.go:43-56 | store/db/postgres/idp.go:42-55 | store/db/sqlite/idp.go:45-58 \u2014 \u0060store/db/postgres/idp.go\u0060 and \u0060store/db/sqlite/idp.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/idp.go:43\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/idp.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f03b3518f5d63684f8e265f0615f0e6dfdc14683db59582ff95c5a1185999da"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): store/db/mysql/inbox.go:88-101 | store/db/postgres/inbox.go:79-92 | store/db/sqlite/inbox.go:80-93 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/inbox.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"04a534838efba652058671f6c1d301315b573976d429c9c801cd3e298eacb825"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): store/db/mysql/memo.go:112-125 | store/db/sqlite/memo.go:104-117 \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 \u0060store/db/mysql/memo.go:112\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"17d33fe4930cb7b463719da83e00a91256d241aa81b6e54de14f65db9c5bf8e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): store/db/mysql/user_setting.go:96-109 | store/db/sqlite/user_setting.go:112-125 \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 \u0060store/db/mysql/user_setting.go:96\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_setting.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac03d112a0c655acd3e45f4ad13300aa789cb9ac75f26a9a635452d55d95174d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): store/db/postgres/memo_relation.go:112-125 | store/db/sqlite/memo_relation.go:96-109 \u2014 \u0060store/db/postgres/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/memo_relation.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"097bdbf71f0071baaa3cf0b604f4d8ac7f86c8dbd2b3dca791e41c0ec1f43750"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): store/db/postgres/user.go:61-74 | store/db/sqlite/user.go:61-74 \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 \u0060store/db/postgres/user.go:61\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eed51e6eec33830483a6cc210c631c4adfda8ad933e47560034f435ad0fd0b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): store/db/mysql/user_delete.go:65-77 | store/db/postgres/user_delete.go:65-77 | store/db/sqlite/user_delete.go:65-77 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0621d0ff2dbbefd8e3284e6409c3ac916c5329d53642b4980af99d81e885966"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): store/db/mysql/user_delete.go:387-399 | store/db/postgres/user_delete.go:350-362 | store/db/sqlite/user_delete.go:350-362 \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 \u0060store/db/mysql/user_delete.go:387\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":"store/db/mysql/user_delete.go"},"region":{"startLine":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba3ad6f4584d35b719c8b7b83e0bf09ca49eda1d5aa083d18da3ed8133fd0327"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): store/db/mysql/memo.go:169-181 | store/db/postgres/memo.go:154-166 | store/db/sqlite/memo.go:160-172 \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 \u0060store/db/mysql/memo.go:169\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":"store/db/mysql/memo.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"c54f4d6574261ee3777bfebb9874c1c6a8b918188f447b9e51404ed4a44ba171"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): server/auth/token.go:147-159 | server/auth/token.go:174-186 \u2014 both copies are in the same file, so extract the block 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 \u0060server/auth/token.go:147\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/auth/token.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fa382fa05ab56f0af11ef643d6250b371eb448cdc6b47bf7217f3ee94b80271"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): server/notification/email.go:255-267 | server/router/api/v1/user_service_notifications.go:227-239 \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 \u0060server/notification/email.go:255\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"server/notification/email.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4ec45f5ade9aee8c685376f44985b62f9ad7cf114a03f8514ea7212695bf213"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): store/db/mysql/attachment.go:106-118 | store/db/sqlite/attachment.go:99-111 \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 \u0060store/db/mysql/attachment.go: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":"store/db/mysql/attachment.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd4f2fad95d50706e1992f60ccc96b486fb09a161e096ebc1d946d6177b74a67"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 6): store/db/mysql/user_identity.go:75-86 | store/db/mysql/user.go:159-170 | store/db/postgres/user.go:59-70 | store/db/postgres/user.go:163-174 | store/db/sqlite/user.go:59-70 | store/db/sqlite/user.go:172-183 \u2014 there are 6 copies across 4 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/user_identity.go:75\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_identity.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"cefd0e0796979ede5ea1eb05c4956824cc0696158faf4f52db7e318347f54284"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_delete.go:32-43 | store/db/postgres/user_delete.go:32-43 | store/db/sqlite/user_delete.go:32-43 \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 \u0060store/db/mysql/user_delete.go:32\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"4beeb601ae4c1c15b61a8da3d6b1dbcc3f46c28ab5657ea7aaf6320c840a3baa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_delete.go:243-254 | store/db/postgres/user_delete.go:206-217 | store/db/sqlite/user_delete.go:206-217 \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 \u0060store/db/mysql/user_delete.go:243\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"8661792a3b7c33142c1026ec4b1ea516d87b1360d6717b9b2199dc89bec15f79"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_delete.go:279-290 | store/db/postgres/user_delete.go:242-253 | store/db/sqlite/user_delete.go:242-253 \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 \u0060store/db/mysql/user_delete.go:279\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"709e011c2e2fa659f7e71f72c9a7fdd17cd2450588534c00eaff36ad41397527"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_delete.go:306-317 | store/db/postgres/user_delete.go:269-280 | store/db/sqlite/user_delete.go:269-280 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d74e06dee0d3fd1e8858276bc162e37309bad8f60660c8713947d81a5c03b34"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_delete.go:322-333 | store/db/postgres/user_delete.go:285-296 | store/db/sqlite/user_delete.go:285-296 \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 \u0060store/db/mysql/user_delete.go:322\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"aba4faedb81874705e185e6d71559a6ba13ee1de921f1c7533daf8e2e742ff0e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): store/db/mysql/user_setting.go:33-44 | store/db/postgres/user_setting.go:46-57 | store/db/sqlite/user_setting.go:46-57 \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 \u0060store/db/mysql/user_setting.go:33\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_setting.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"64f8638c6e824487a8d400aa3ba1fccf6744d68b0dc92f5694ee32ff829ec0dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): server/cors.go:42-54 | server/router/mcp/origin.go:15-26 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/cors.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"6abd4c16185d43bf093491ff48bba616de779df1c9f63c053186dc4be9abeff9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): server/router/api/v1/shortcut_service.go:107-118 | server/router/api/v1/shortcut_service.go:296-307 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/shortcut_service.go:107\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"server/router/api/v1/shortcut_service.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a959c085ca1aa56a131277c9e962649a01a34b8579e0d6eea038ae219550252"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): server/router/api/v1/shortcut_service.go:230-241 | server/router/api/v1/shortcut_service.go:300-311 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/shortcut_service.go:230\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":"server/router/api/v1/shortcut_service.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"e14f8d9e6a0b49aa351b4b3feb535af74e5bc037f4597ffa88f8ec8f7c111d09"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): store/db/postgres/idp.go:98-110 | store/db/sqlite/idp.go:99-110 \u2014 \u0060store/db/postgres/idp.go\u0060 and \u0060store/db/sqlite/idp.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/idp.go:98\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/idp.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bcd0e9fceca7c2c626a36288b2b1b9dbb9c4441f9a8cd94d7f74ff3ee594965"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): store/db/postgres/inbox.go:128-139 | store/db/sqlite/inbox.go:118-129 \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 \u0060store/db/postgres/inbox.go:128\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/inbox.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"6509a338dc2487d79b2acb8966deb22d371bf021eccbc21e4e07046f73e34585"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 4): store/db/mysql/inbox.go:30-41 | store/db/mysql/memo.go:42-52 | store/db/mysql/memo_share.go:24-34 | store/db/mysql/reaction.go:17-27 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/inbox.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"d89274cba82fc91075a0811010b70e2a351b59f8cf846a84f0979c13e9ef6aed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): store/db/mysql/user_delete.go:109-119 | store/db/postgres/user_delete.go:109-119 | store/db/sqlite/user_delete.go:109-119 \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 \u0060store/db/mysql/user_delete.go:109\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"66f52e7e4dec7655f988076f1701449fb4e0e8f805fc1f1ab34c3ac0a0f0824f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): store/db/mysql/user_delete.go:186-196 | store/db/postgres/user_delete.go:149-159 | store/db/sqlite/user_delete.go:149-159 \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 \u0060store/db/mysql/user_delete.go:186\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"0738c232cc8a504837b52bfccb203af236062053e9cedc7a66ee4a4956d53ce0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): server/router/api/v1/user_service_notifications.go:30-40 | server/router/api/v1/user_service_settings.go:25-37 | server/router/api/v1/user_service_settings.go:181-192 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/user_service_notifications.go:30\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"server/router/api/v1/user_service_notifications.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3b642d31afcac220e44201bb262b7a930ac60028e7d80e62e1e0411d61970d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): store/db/mysql/attachment.go:22-32 | store/db/postgres/attachment.go:21-31 | store/db/sqlite/attachment.go:22-32 \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 \u0060store/db/mysql/attachment.go:22\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/attachment.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bc44d5dfbe9e030ef9ac2af0406602b9b5b490ca83e5c64333b60dd159c6a20"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): store/db/mysql/auth_config.go:57-67 | store/db/postgres/auth_config.go:57-67 | store/db/sqlite/auth_config.go:59-69 \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 \u0060store/db/mysql/auth_config.go:57\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":"store/db/mysql/auth_config.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"24453361e3cfe6cc3dbda77332e4e137694a7e7f53b6081bc6beb2bf6ea1ed3f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): internal/filter/parser.go:315-325 | internal/filter/parser.go:349-359 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/filter/parser.go:315\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/filter/parser.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff5f0093f99e356a3132076d3c7dd1bc5bc36c22b2dcd1f4e07b5786774cc86e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/memo_service.go:373-383 | server/router/api/v1/memo_service.go:546-556 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/memo_service.go:373\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"29219ace90f399ce96eb6a56b61ca4603823ccfaf62cab34d13535b467a3b2ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): store/db/postgres/user_identity.go:58-68 | store/db/sqlite/user_identity.go:58-68 \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 \u0060store/db/postgres/user_identity.go:58\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user_identity.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2326a0723b85dc50bce01a12236881ff37f49f77b3a5ea9bb26dc109fafd2dc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/instance_service_validation.go:158-168 | server/router/api/v1/user_service.go:43-53 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/instance_service_validation.go:158\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service_validation.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3d2bbe8c03bdd77c1feb09d42b71de6a4c284852c5d438cd52fa38795d89584"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/memo_attachment_service.go:206-216 | server/router/api/v1/reaction_service.go:22-32 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_attachment_service.go:206\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":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"a65b94bf9c4b919decdca935a590ae69313ba1cbae66f7850d6d9f9e150d203e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/user_service_identities.go:86-96 | server/router/api/v1/user_service_identities.go:111-121 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/user_service_identities.go:86\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_identities.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea3d94551760a908ca5a4a8b56ab4ade755eee7c18c266694b15f0e10b02f483"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/user_service_notifications.go:94-104 | server/router/api/v1/user_service_notifications.go:165-175 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/user_service_notifications.go:94\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":"server/router/api/v1/user_service_notifications.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e4dadf1a3b95b6dd4fe86b35031477b36365364d5ba1da48d5e2330f81d1b56"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/router/api/v1/user_service_stats.go:96-106 | server/router/api/v1/user_service_stats.go:231-241 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/user_service_stats.go:96\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_stats.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd3baa1c2b5e0e3d0a54ee82617160c2840ab53ccbb3a9169c1fd9a39d28ec9d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): store/db/mysql/attachment.go:77-87 | store/db/sqlite/attachment.go:70-80 \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 \u0060store/db/mysql/attachment.go:77\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":"store/db/mysql/attachment.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7face8d27c80f7c44ebbfe21ad4b37c9a3a9cd2c2eeee449c9547f6d17e86aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): store/db/mysql/memo.go:22-32 | store/db/sqlite/memo.go:22-32 \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 \u0060store/db/mysql/memo.go:22\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"929b12872267c1eed69d8e20ebcaae11d2b6fac5715af55f57f660a723e8cbfc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): store/db/mysql/memo.go:242-252 | store/db/sqlite/memo.go:220-230 \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 \u0060store/db/mysql/memo.go:242\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":"store/db/mysql/memo.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"978b603f3fe9afabb336b16bd1704d25591e5901661fd64c3e57b6c1f0dd2a00"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 6): store/db/mysql/attachment.go:35-45 | store/db/mysql/idp.go:19-29 | store/db/mysql/inbox.go:30-40 | store/db/mysql/memo.go:42-51 | store/db/mysql/memo_share.go:24-33 | store/db/mysql/reaction.go:17-26 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/attachment.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e7e26761b4849d1e1b06ee200c5bd1cce3346c00a34002bf07769acb8770937"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): store/db/mysql/user_delete.go:444-453 | store/db/postgres/user_delete.go:407-416 | store/db/sqlite/user_delete.go:407-416 \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 \u0060store/db/mysql/user_delete.go:444\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"28b731698540aa747cd2aa214e13dc27633dce7d4a01ef8e913280079e4fd97a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): server/router/api/v1/idp_service.go:20-29 | server/router/api/v1/idp_service.go:149-158 | server/router/api/v1/user_service.go:58-67 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/idp_service.go:20\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":"server/router/api/v1/idp_service.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"9677c2fa1984c5d06802fb2310dd4b6718a79e2a36111c79b7150d3e807a9364"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): server/router/api/v1/user_service_identities.go:47-56 | server/router/api/v1/user_service_notifications.go:100-110 | server/router/api/v1/user_service_notifications.go:171-181 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/user_service_identities.go:47\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":"server/router/api/v1/user_service_identities.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"c33b637b08d8dd4b1a528ad8407e9e6fce1a93789ead293b79d92c0d8bfd307f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): store/db/mysql/auth_config.go:25-34 | store/db/postgres/auth_config.go:25-34 | store/db/sqlite/auth_config.go:27-36 \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 \u0060store/db/mysql/auth_config.go:25\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/auth_config.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcfa74df4bef2a2e91f5149f6d26d4f94b2ab679da426027b5ea8dfd2fcb518b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): internal/markdown/extensions/mention.go:54-63 | internal/markdown/extensions/tag.go:102-111 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/markdown/extensions/mention.go:54\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/extensions/mention.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"01ef0e5287b1fbff2f4c039f0bd1ff4e0a8ff374e71e6e600066ff7ba76b5efc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/notification/email.go:235-244 | server/router/api/v1/memo_batch_helpers.go:25-34 \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 \u0060server/notification/email.go:235\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/notification/email.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"46b907ddfd86b91efba4f9ac524b7857ab6cef6654d6bbe030b46d69e41b61c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/memo_service.go:250-259 | server/router/api/v1/memo_service_comments.go:186-195 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:250\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"493857e889eb1f89e04015b457e3f42122039548d4463841ee6a2ffa3edc6a14"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/memo_service.go:343-352 | server/router/api/v1/memo_service.go:520-529 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/memo_service.go:343\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"e703215ab5af7203ac3b81c920428e6c23ceea7bcd51d9da818575a7c6ba458c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/memo_service.go:414-423 | server/router/api/v1/memo_service.go:529-538 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:414\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"f413d03368fc6eb76bfccd2c5e1567ac0bf2fe9ad83491a98c64c5161152aca1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/memo_batch_helpers.go:15-24 | server/router/api/v1/user_service_stats.go:22-31 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_batch_helpers.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2525678ceffcf82e17b3f83317c1e73741faa79e5f50eb4ce8874244df6bc54"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/memo_share_service.go:24-33 | server/router/api/v1/memo_share_service.go:73-82 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/memo_share_service.go:24\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":"server/router/api/v1/memo_share_service.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"53318ff779e784d9525c5c94f7cda2083a76b4f5b3fa4aad937bd958aa5f0569"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/shortcut_service.go:51-60 | server/router/api/v1/shortcut_service.go:137-146 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/shortcut_service.go:51\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":"server/router/api/v1/shortcut_service.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"abdd1c14c9a78abca5eeedde7667f07c3e27150d54f6bb01707d6d4ce6d69de2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/user_service_settings.go:18-27 | server/router/api/v1/user_service_settings.go:56-65 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/user_service_settings.go:18\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_settings.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"0de1c9e534583dc201608ea1c925cfd23b5d8ec5dcf653e3a2bf1646c47dd045"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/user_service_webhooks.go:22-31 | server/router/api/v1/user_service_webhooks.go:55-64 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/user_service_webhooks.go:22\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_webhooks.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4c73b25db7c2a249f2943b4218216e29b6e1ebc1052aed19e00d28161be9b96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/router/api/v1/user_service_webhooks.go:112-121 | server/router/api/v1/user_service_webhooks.go:207-216 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/user_service_webhooks.go:112\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service_webhooks.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"99699eb7b2f505c3dc4ab59d7aab0f8e574a3a9d025b3526238b6d3c925e7d69"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): store/db/mysql/inbox.go:16-25 | store/db/sqlite/inbox.go:16-25 \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":"store/db/mysql/inbox.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc6020fec54de4f7a23289db60df2c4abee7d9777f0be9d8bdd79dffaf5e8421"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): store/db/mysql/memo.go:261-270 | store/db/sqlite/memo.go:239-248 \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 \u0060store/db/mysql/memo.go:261\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e7dc9c029c377d6610eebfafb26dabc80aff39fc30c4d46a3f7eb2cc85d89e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): store/db/mysql/user.go:98-107 | store/db/sqlite/user.go:96-105 \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 \u0060store/db/mysql/user.go:98\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":"store/db/mysql/user.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b95cd39d5a4a9d457182671d5fbb763472290c413bf07e8575816ecaa86f286"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): store/db/postgres/idp.go:114-123 | store/db/sqlite/idp.go:114-123 \u2014 \u0060store/db/postgres/idp.go\u0060 and \u0060store/db/sqlite/idp.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/idp.go:114\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/idp.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac3d8f1dc3e4dcfc0c88eaa56da9c66f2d4393e0774cc609b6cc7b9445783a87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): store/db/postgres/memo_relation.go:78-87 | store/db/sqlite/memo_relation.go:76-85 \u2014 \u0060store/db/postgres/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/memo_relation.go:78\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":"store/db/postgres/memo_relation.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb21ad35ab3e2d17d6b5e48011217fd9a4c02726c196030f020cc92b5133d444"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): server/router/api/v1/instance_service.go:181-189 | server/router/api/v1/instance_service.go:257-265 | server/router/api/v1/instance_stats.go:48-56 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/instance_service.go:181\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":"server/router/api/v1/instance_service.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"9450ddf08a22ecdd7453b531f68c6d8d7dddfb6185ac1ae43fedd5df11698584"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): store/db/mysql/user_delete.go:518-526 | store/db/postgres/user_delete.go:481-489 | store/db/sqlite/user_delete.go:481-489 \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 \u0060store/db/mysql/user_delete.go:518\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":"store/db/mysql/user_delete.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d9f095822a63749db49b0501a79cdccd9aaf411184b49f60dc8cf701a14a604"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/markdown/extensions/mention.go:70-78 | internal/markdown/extensions/tag.go:118-126 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/markdown/extensions/mention.go:70\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/extensions/mention.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fdba7b87202ef3f63bab53d949273d8b3339cbbb193b9feb38885e462e1023a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): internal/markdown/renderer/markdown_renderer.go:81-89 | internal/markdown/renderer/markdown_renderer.go:111-119 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/renderer/markdown_renderer.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"23d7495613566286e33ca83cf160e028a0cf03204198be975cb85d8370947c3d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/memo_service.go:293-301 | server/router/api/v1/memo_service_comments.go:238-246 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:293\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc17fc5dce80654cfe33edfc55c8d15c99a6e1ed5d47d5622ced9cfea8a91084"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/rss/rss.go:95-103 | server/router/rss/rss.go:150-158 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/rss/rss.go:95\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":"server/router/rss/rss.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac3b4028540754f2b710adbe874714bda84a96b972574301a58087d844e878f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/auth_service_session.go:51-59 | server/router/api/v1/auth_service_session.go:167-175 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/auth_service_session.go:51\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/auth_service_session.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"4820b170ff696a36649b52be1dd153fdf20544be656d674c225926e6c50cd359"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/idp_service.go:97-105 | server/router/api/v1/idp_service.go:159-167 \u2014 both copies are in the same file, so extract the block 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":"server/router/api/v1/idp_service.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b57ab302d8a29aacb7aad4ea53ea62a2a25bbb7d26dece3a332c2db9d8e2b75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/instance_service_validation.go:148-156 | server/router/api/v1/user_service.go:33-41 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/instance_service_validation.go:148\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service_validation.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fd81770e5d7e3319422e7eadb8858e04dd74e981973d9659c55d4e5693a4d32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/memo_attachment_service.go:18-26 | server/router/api/v1/memo_relation_service.go:18-26 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_attachment_service.go:18\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ec7ebe3e752421805d0171bb9a0bcf6453b77b141dc64b54697605f15724e29"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/memo_attachment_service.go:42-50 | server/router/api/v1/memo_relation_service.go:42-50 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_attachment_service.go:42\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"13901ff35abc847e22ceaee4b22df892a5cda8b019ebcb357ce713d847b4d5a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/memo_attachment_service.go:219-227 | server/router/api/v1/reaction_service.go:35-43 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_attachment_service.go:219\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":"server/router/api/v1/memo_attachment_service.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"2128aa6c831c5b6a6fca71eaf881f6ec3d388846829c9fce4f9b014c54c13566"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/memo_service_comments.go:167-175 | server/router/api/v1/user_service.go:83-92 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service_comments.go:167\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":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4f6cf25a531eeea3ff865633f4ade49b03b53af90337446123f4d7d143f5af6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/user_service.go:295-303 | server/router/api/v1/user_service.go:401-409 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/user_service.go:295\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"540ffe688129b11a5157621022f0d1a56e72b27e3cac97b28c70c6a3253985c9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/router/api/v1/user_service.go:397-405 | server/router/api/v1/user_service_stats.go:193-202 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/user_service.go:397\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":"server/router/api/v1/user_service.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"133c33acedafc636a74628120b1d2dc84e18ab5a61e883f38e459e6930d2c19f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/attachment.go:210-218 | store/db/sqlite/attachment.go:191-199 \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":"store/db/mysql/attachment.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecdb57a5df4d66d92455c3d419e812c8dd687ab64c56ebddbb18a167b4cb2f9c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/inbox.go:58-66 | store/db/sqlite/inbox.go:50-58 \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 \u0060store/db/mysql/inbox.go:58\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/inbox.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa3b0d8358391b3e742b5349f6d320bd78d4a8c5c4fb9b6302c8a79915f40f40"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/inbox.go:117-125 | store/db/postgres/inbox.go:108-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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/inbox.go:117\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/inbox.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"703d4ca4d772d9acb8448bf58d03bd37ffefb5b37e036b6230412fbd597ef495"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/memo.go:77-85 | store/db/sqlite/memo.go:69-77 \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 \u0060store/db/mysql/memo.go:77\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":"store/db/mysql/memo.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca539ed8a1f832fbedabd7a06ba4028ee2fc09a8b7cafddd3527b1800738819c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/memo_relation.go:47-55 | store/db/sqlite/memo_relation.go:54-62 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7c215f00bb14513b08f7db7623d33f4895825243f829b4a5991872ca1fc5ec9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/memo_share.go:15-23 | store/db/sqlite/memo_share.go:15-23 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_share.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"87eaa56b5bc68040153a88f83390197be98e96bf44ce688bb2c78bfd5de3a564"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/mysql/user.go:109-117 | store/db/sqlite/user.go:107-115 \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 \u0060store/db/mysql/user.go:109\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":"store/db/mysql/user.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"46abecc137dc69eac03f1897ac40e60f853f3321a492e672473d3af589363e35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): store/db/postgres/user.go:78-86 | store/db/sqlite/user.go:78-86 \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 \u0060store/db/postgres/user.go:78\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f67971525c23b00f47c31d53ee172d47135f4dbfc47a1c6406faf49e4050807"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): server/router/api/v1/instance_service.go:143-150 | server/router/api/v1/instance_service.go:182-189 | server/router/api/v1/instance_service.go:258-265 | server/router/api/v1/instance_stats.go:49-56 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/instance_service.go:143\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":"server/router/api/v1/instance_service.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca5aa45e0e5bf424ec88d539425cbe8c7e98fb5940b11015d0217e4c4b968762"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): server/router/api/v1/memo_relation_service.go:29-36 | server/router/api/v1/memo_share_service.go:37-44 | server/router/api/v1/memo_share_service.go:86-93 | server/router/api/v1/memo_share_service.go:127-134 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_relation_service.go:29\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":"server/router/api/v1/memo_relation_service.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"afd71457fac187f71905d5d5de8d03735c818d0dfeea120c9092dc792d04077a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): store/db/mysql/user_delete.go:478-485 | store/db/postgres/user_delete.go:441-448 | store/db/sqlite/user_delete.go:441-448 \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 \u0060store/db/mysql/user_delete.go:478\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"25e7151ac29540bfd36772f5e6bddf608d2fb1bc106f920f1307cfbd1ac535a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): store/db/mysql/auth_config.go:35-42 | store/db/postgres/auth_config.go:35-42 | store/db/sqlite/auth_config.go:37-44 \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 \u0060store/db/mysql/auth_config.go:35\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":"store/db/mysql/auth_config.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"48be6a1a445ccad63eb5b0d8491d3a1d59b8976101f7dbc5fc40a479f66d60c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): internal/email/client.go:92-99 | internal/email/client.go:126-134 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/email/client.go:92\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/email/client.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"82b8342bf1d371de461e5480605c6170feed8e463c26cda90ee9a3d9036933ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/memo_service.go:229-236 | server/router/api/v1/user_service.go:79-86 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:229\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"59fe1accb0f53a577f7064d1b0c0513fe48dee3dd9926e1a450cfd90109c6e56"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/memo_service.go:314-321 | server/router/api/v1/memo_service_comments.go:260-267 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:314\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"07501cbc23004583a01dade8d81ca8b5e692eb0007f7ed38105e743781f697c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/fileserver/fileserver.go:222-230 | server/router/fileserver/fileserver.go:269-276 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/fileserver/fileserver.go:222\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/fileserver/fileserver.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad924a921c32765c79ab5a2595fce301d699d6d37984b9f281e793b65b006fdb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/rss/rss.go:83-90 | server/router/rss/rss.go:127-134 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/rss/rss.go:83\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"server/router/rss/rss.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"81981b0352119da507a5aac03ee94a7344ae4ebe3462ef035736fdbc3215c1c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): store/db/mysql/user_identity.go:163-170 | store/db/sqlite/user_identity.go:141-148 \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 \u0060store/db/mysql/user_identity.go:163\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_identity.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"b26c32b8190788e844456dbf89d55e9db573ff9fc97d43a79ab4fade6f21b36c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/attachment_service.go:271-278 | server/router/api/v1/attachment_service.go:317-324 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/attachment_service.go:317\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fd838b07e05075c08d9954e33180466a239a44733b9def90fdfc3519ed08543"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/attachment_service.go:279-287 | server/router/api/v1/attachment_service.go:374-381 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/attachment_service.go:279\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":"server/router/api/v1/attachment_service.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"00d55b781e6cccdd04c2d4bc8400c4a5475a9debbf146176ca436d2c91a89979"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/auth_service_session.go:33-40 | server/router/api/v1/auth_service_session.go:142-149 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/auth_service_session.go:33\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":"server/router/api/v1/auth_service_session.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82058fb537d1a49e3d0e3bf3bd1b92d55344e24663202a90985096a299ca223"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/auth_service_session.go:334-341 | server/router/api/v1/auth_service_session.go:343-350 \u2014 both copies are in the same file, so extract the block 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":"server/router/api/v1/auth_service_session.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebf2db9b65510e126f32574b3a2b5415bc02b543fdaa589dfeb88e9f39b5eeb9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/router/api/v1/memo_service_comments.go:34-41 | server/router/api/v1/reaction_service.go:31-38 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service_comments.go:34\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":"server/router/api/v1/memo_service_comments.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7d29f432d862f0413eecdc0821a2bb959157cd8e6c5b3e556fc7e96eee704d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): store/db/postgres/inbox.go:28-36 | store/db/postgres/memo_share.go:22-29 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/inbox.go:28\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/inbox.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d5992375017842759d9458867085e9134f170b5d8481fba0e3da5ede2b183d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): store/db/sqlite/inbox.go:30-38 | store/db/sqlite/memo_share.go:24-31 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/sqlite/inbox.go:30\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/sqlite/inbox.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"c408d9e7e7483f350f9fab5e25b0ffe34d74ff9dfcd74a60e076cce4a6395476"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): server/router/api/v1/attachment_service.go:248-256 | server/router/api/v1/attachment_service.go:279-286 | server/router/api/v1/attachment_service.go:374-380 \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 \u0060server/router/api/v1/attachment_service.go:248\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"a680a1fd3e3bad6ae1248f28a52669d7b12ea123cc84fa67735dd99530bed48d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): internal/markdown/extensions/gfm.go:150-156 | internal/markdown/extensions/gfm.go:183-189 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060internal/markdown/extensions/gfm.go:150\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/extensions/gfm.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"26cf85a7e57cc20443d99e6969c65211149eeb7dda3346294104748d6b1aa3de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): server/notification/email.go:214-220 | server/router/api/v1/memo_batch_helpers.go:10-16 \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 \u0060server/notification/email.go:214\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":"server/notification/email.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdb9544c2c9e58dffb1f61e150aa5086f6ee19e80445c8e2744ffbf409efb311"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): server/router/api/v1/memo_service.go:283-290 | server/router/api/v1/memo_service_comments.go:228-234 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:283\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"5edb6f4e539c65eede1ca2dff75b6a6449471dac542be76c4d219593b5e5400b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): server/router/api/v1/memo_service.go:359-365 | server/router/api/v1/memo_service.go:454-460 \u2014 both copies are in the same file, so extract the block 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 \u0060server/router/api/v1/memo_service.go:359\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea6178a12b45e56837fdd0f8f305285db50c325edc1fc8196163f2881dae31a0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/attachment.go:50-56 | store/db/sqlite/attachment.go:43-49 \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 \u0060store/db/mysql/attachment.go:50\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":"store/db/mysql/attachment.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cd4d457642bbc7f57cd824bf8aabe83771e0c1dfc2db296a9b60f10a34c3947"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/attachment.go:193-199 | store/db/sqlite/attachment.go:174-180 \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 \u0060store/db/mysql/attachment.go:193\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":"store/db/mysql/attachment.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2a36f3ac42ad4da1c62933ab1adf0a293eb5e82f4c9ba94cbd0215568a55fca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/memo_relation.go:36-42 | store/db/mysql/memo_relation.go:128-134 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:36\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"86af991d4c9b4a7c7fe285f32fd517d0362303da99d89f2be3470613ada17ece"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/memo_relation.go:57-63 | store/db/sqlite/memo_relation.go:64-70 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:57\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":"store/db/mysql/memo_relation.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d0f648455a2a91b03be333a717fcdd8462c28ec313dfea8859fe1254c09642d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/memo_relation.go:65-71 | store/db/sqlite/memo_relation.go:72-78 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:65\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ffc71a5d15e0ffda183e5a741c7caabfca79bc9ef8a717127b20742b1385479"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/memo_relation.go:81-88 | store/db/sqlite/memo_relation.go:86-92 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:81\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"6045966d21a2260d2e313d3c6ca57eef88c30081469f334bac7b9048630506f2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/mysql/memo_share.go:113-119 | store/db/sqlite/memo_share.go:136-142 \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":"store/db/mysql/memo_share.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc9e162ab206ec32032b3596b2915e1bec3c16938630edaa3bc8aaa9cc3066d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/postgres/memo_relation.go:70-76 | store/db/sqlite/memo_relation.go:68-74 \u2014 \u0060store/db/postgres/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/memo_relation.go:70\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":"store/db/postgres/memo_relation.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb87314480bb6f5831a87ec8c9f200284f14673514e068c301b93f9d79a31060"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/sqlite/memo_relation.go:43-49 | store/db/sqlite/memo_relation.go:139-145 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/sqlite/memo_relation.go:43\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":"store/db/sqlite/memo_relation.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b020d3cd2afb4db4df61e9d475e107c7bb33fec48f5564b763482a007c96985"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): store/db/sqlite/reaction.go:29-35 | store/db/sqlite/reaction.go:93-99 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/sqlite/reaction.go:29\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":"store/db/sqlite/reaction.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"00adca58995371b894e5f57fd8ac6a1fbf7ff36d21d22e9be85947fe8c552b83"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 13): server/router/api/v1/attachment_service.go:132-137 | server/router/api/v1/memo_attachment_service.go:25-30 | server/router/api/v1/memo_attachment_service.go:202-207 | server/router/api/v1/memo_relation_service.go:25-30 | server/router/api/v1/memo_relation_service.go:95-100 | server/router/api/v1/memo_service_comments.go:22-27 | server/router/api/v1/memo_service_comments.go:64-69 | server/router/api/v1/memo_service_comments.go:138-143 | server/router/api/v1/memo_share_service.go:33-38 | server/router/api/v1/memo_share_service.go:82-87 | server/router/api/v1/reaction_service.go:18-23 | server/router/api/v1/reaction_service.go:71-76 | server/router/api/v1/reaction_service.go:148-153 \u2014 there are 13 copies across 6 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 13 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/attachment_service.go:132\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/attachment_service.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"f998b0cc062546d07c342f62b6f91494e0bb166649ea5516a381f8eabc106486"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): store/db/mysql/user_delete.go:508-513 | store/db/postgres/user_delete.go:471-476 | store/db/sqlite/user_delete.go:471-476 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_delete.go"},"region":{"startLine":508}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ba204eb80a14bfc4d499465e1e035e2aa620d3b7e45fd90b4507601858042b8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): store/db/mysql/memo_relation.go:73-79 | store/db/postgres/memo_relation.go:82-88 | store/db/sqlite/memo_relation.go:80-85 \u2014 \u0060store/db/mysql/memo_relation.go\u0060 and \u0060store/db/sqlite/memo_relation.go\u0060 are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other \u2014 this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo_relation.go:73\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/memo_relation.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ae2ebb36328b82808ae2113419201a6557e316e10ca082b392df7ef2f5bff86"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): server/router/api/v1/memo_service.go:218-224 | server/router/api/v1/user_service_stats.go:84-89 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/router/api/v1/memo_service.go:218\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":"server/router/api/v1/memo_service.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"272ff165a0e20b7b978530458227e935cbcc09603edbe7f74f87b69eb3323600"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/postgres/user_identity.go:80-85 | store/db/postgres/user_identity.go:136-141 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/postgres/user_identity.go:80\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":"store/db/postgres/user_identity.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e53652d630ebaf76cf24ce538ada35c1c9f892f63646d7a92b5572f5a5bd1e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/mysql/memo.go:218-223 | store/db/sqlite/memo.go:196-201 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/memo.go:218\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":"store/db/mysql/memo.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d9f2ac7a570aa3b421e5a7c08c360bbab1ac48813a1015441474244d625b0bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/mysql/user.go:41-46 | store/db/mysql/user.go:116-121 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ca181d51db61cc7f38c47e5125a9288ae1c5f15b3e6be6341b3fcc987794d6b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/mysql/user.go:90-95 | store/db/sqlite/user.go:88-93 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/mysql/user.go:90\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":"store/db/mysql/user.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"73b2cd0d1baf6260a32fa38f9afefd064bd61a281a8da9e6c73a596678367126"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/mysql/user_setting.go:22-27 | store/db/mysql/user_setting.go:61-66 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/mysql/user_setting.go:22\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/mysql/user_setting.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"62735f4c7f6ab3141402663f7c6285d7637e4f087cb1be1f972dff0cd8ebc000"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/sqlite/user.go:25-30 | store/db/sqlite/user.go:114-119 \u2014 both copies are in the same file, so extract the block 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":"store/db/sqlite/user.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"2583c70ddbcec4e994de41e2e6846790ac61a04c1e096c2cab4a12e1e130e16e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): store/db/sqlite/user_setting.go:29-34 | store/db/sqlite/user_setting.go:73-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 \u0060store/db/sqlite/user_setting.go:29\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":"store/db/sqlite/user_setting.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1d2962d8b79af0db63deb2e24c438eb1f086339dac28c5fb4351c674156e9c3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): store/db/postgres/memo_share.go:32-37 | store/db/postgres/memo_share.go:88-93 | store/db/postgres/memo_share.go:133-137 \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 \u0060store/db/postgres/memo_share.go:32\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":"store/db/postgres/memo_share.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f74b5ff45c2ea2da4ba0a5a0194e10c68a043f18d60d54032d4fd67fd8e58b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/attachment.go:174-179 | store/db/postgres/memo.go:203-207 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/attachment.go:174\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":"store/db/postgres/attachment.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfb37ed60fa054329a19a2143721a2c9b3a64d393ad37145530b5f57858270fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/memo.go:210-214 | store/db/postgres/user.go:22-26 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/memo.go:210\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":"store/db/postgres/memo.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5257c03918c61daf59aedbd6e9094730e2ce1913219231d1dd3395cedc0afa8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/memo_relation.go:42-46 | store/db/postgres/memo_relation.go:154-158 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/postgres/memo_relation.go:42\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":"store/db/postgres/memo_relation.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"c53a21914354b105d1d4ffe1e690ff45b391a9d897d798c43cfcb3802a7e2502"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/user.go:25-29 | store/db/postgres/user.go:104-108 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/postgres/user.go:25\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":"store/db/postgres/user.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"dead4c506015bf01ffb38a7bf743f306f569346f44419943bfa8764f8d51e2f0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/user.go:31-35 | store/db/postgres/user.go:113-117 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060store/db/postgres/user.go:31\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"store/db/postgres/user.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"872647c1395a22e65ea962b4ca1d8fd5fb1517a07630dfd985f8c2d0dd819a8f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): store/db/postgres/user_setting.go:31-35 | store/db/postgres/user_setting.go:76-80 \u2014 both copies are in the same file, so extract the block 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 \u0060store/db/postgres/user_setting.go:31\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"store/db/postgres/user_setting.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"d48253b5d674826d8d484793885fbe2b599bb2f225c194ddfc7c98326e5e0f87"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/components/PagedMemoList/PagedMemoList.tsx: web/src/components/PagedMemoList/PagedMemoList.tsx changed 15 times in last 90 days, max complexity 30. 3 of those changes were fix/bug commits, and the other 12 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/PagedMemoList/PagedMemoList.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1468bb2ab8dc2aac1c58b7518e088e60db177dc71b471ab41a5ae314360e72de"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/router/api/v1/user_service.go: server/router/api/v1/user_service.go changed 9 times in last 90 days, max complexity 32. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/user_service.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b5ab693b437ae9ff9f345575001a3630978a5681e02127ab2adde18c4696901"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/router/api/v1/memo_service.go: server/router/api/v1/memo_service.go changed 7 times in last 90 days, max complexity 34. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/memo_service.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"94947b79abbc6339b88600ae97f0629d20fe0d611caf3f32f3343036d2a7a879"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/pages/MemoDetail.tsx: web/src/pages/MemoDetail.tsx changed 8 times in last 90 days, max complexity 26. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/pages/MemoDetail.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e8fbc9b4e2961ee2f1ee219c19b2b510c9d9d742f5c1bd9092658e20e3a0f05"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/components/MemoEditor/index.tsx: web/src/components/MemoEditor/index.tsx changed 9 times in last 90 days, max complexity 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/MemoEditor/index.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"75b4d66a6d03fe965c3a24b3ba7a65f6bd23953d5bf2d5cfd88608633ad55234"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/router/api/v1/instance_service.go: server/router/api/v1/instance_service.go changed 6 times in last 90 days, max complexity 29. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/router/api/v1/instance_service.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf6a5d5bc4fabc99c15861467cd7c450adbc0bfd3ba7c7da20388f6266aba7f6"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/utils/tag-grammar.ts: web/src/utils/tag-grammar.ts changed 6 times in last 90 days, max complexity 18. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/utils/tag-grammar.ts"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"96ddab9b5131f55289190cf6c4ea1ba4ae7235effe712ee6c9d27d82fa8318dc"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: internal/markdown/renderer/markdown_renderer.go: internal/markdown/renderer/markdown_renderer.go changed 2 times in last 90 days, max complexity 51. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/markdown/renderer/markdown_renderer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c67807e45ab1ff326cbd1c8306f41b8efcf7e879e9928e0c644b64ce67db4d57"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/components/ColumnGrid/ColumnGrid.tsx: web/src/components/ColumnGrid/ColumnGrid.tsx changed 5 times in last 90 days, max complexity 19. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/ColumnGrid/ColumnGrid.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"318802c7f617a4118409125979dc3db6d66a16dd2957455abb3d15017501543b"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: web/src/utils/remark-plugins/remark-tag.ts: web/src/utils/remark-plugins/remark-tag.ts changed 5 times in last 90 days, max complexity 17. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/utils/remark-plugins/remark-tag.ts"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaddbff7182d0915e0dda4288b52a39d0b1afb197818674fb57abf0daa2fd965"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: internal/filter/parser.go, internal/filter/schema.go, web/src/components/MemoEditor/hooks/useAudioRecorder.ts, web/src/components/Settings/LinkedIdentitySection.tsx, server/router/api/v1/connect_interceptors.go, web/src/utils/media-item.ts, web/src/components/MemoActionMenu/MemoShareImageDialog.tsx, internal/filter/ir.go (\u002B11 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"fcee350e10ccc176ccd26854ed7daf029cb04fdb13468ce54b335b8e25133253"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold \u2014 folded into the bus-factor score and metrics (21 single-owned of 309 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5c9db534a90dfa20d7e7e259f04e6e8060cc89ca08cf98eee84eabfc66166965"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d64fa3f1aa827af50bef6d03f7b9f538f24fa10f25d8d96f9f4a4561c743034e"}},{"ruleId":"D28","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3cdfd7beb31b791ae18dcb425e21eb157c842e7bbcd522cc330573c1a6538db1"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"00e552187380c93bba43c59bb8b708c4d47af430ff33f7e54070ba122b3a86a2"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"21b3ab54e0ca6a09ee2890a909e5f741747235861c9595554c72e554097105b3"}},{"ruleId":"D31","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4e63315c89fa47d45c7ad12391cc37617447869a7fb0b82d14131f65f4f5a81b"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 6 of 309 analysed file(s) have no living knowledge left \u2014 their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each \u2014 largest first: web/src/components/Inbox/MemoMentionMessage.tsx, server/router/api/v1/memo_mention_helpers.go, store/db/postgres/memo_share.go (and 3 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ce861fd78f6935114d3a342cb90ad25870f984e1042954fcbbe27c0e23be3658"}},{"ruleId":"D35","level":"error","message":{"text":"Boundary-crossing change coupling: webhook.go \u2194 memo_service.go: \u0060internal/webhook/webhook.go\u0060 (context internal) and \u0060server/router/api/v1/memo_service.go\u0060 (context router) sit in DIFFERENT parts of the tree yet change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) \u2014 the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can\u0027t see."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/webhook/webhook.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"876f2bb7f17194f44d4d20f4f714dd73be92f16935838258bf24250b9d00ee9b"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: PreferencesSection.tsx \u2194 setting.d.ts: \u0060web/src/components/Settings/PreferencesSection.tsx\u0060 and \u0060web/src/types/modules/setting.d.ts\u0060 change together 84% of the time (26 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/Settings/PreferencesSection.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb418da553e39531f14f08f40485739cf06f90b38a1fc99a0f83d2b40dc85ef1"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: SignIn.tsx \u2194 SignUp.tsx: \u0060web/src/pages/SignIn.tsx\u0060 and \u0060web/src/pages/SignUp.tsx\u0060 change together 72% of the time (31 of the 43 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module \u2014 a sibling reference still needs an import \u2014 so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/pages/SignIn.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"963a91885c9b14261e96fdb50a93ccda4f25b4ea2f69fc2ee4ee8be6e006c2e3"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: LocationDisplayView.tsx \u2194 RelationListView.tsx: \u0060web/src/components/MemoMetadata/Location/LocationDisplayView.tsx\u0060 and \u0060web/src/components/MemoMetadata/Relation/RelationListView.tsx\u0060 change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/MemoMetadata/Location/LocationDisplayView.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7c7c38e2e944db817b75faacdd5d13d675194b0d44e761ecb422619fe6d2adc"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: AuthCallback.tsx \u2194 SignIn.tsx: \u0060web/src/pages/AuthCallback.tsx\u0060 and \u0060web/src/pages/SignIn.tsx\u0060 change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module \u2014 a sibling reference still needs an import \u2014 so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/pages/AuthCallback.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"564560bf6c24aef60dbc2097456b312daf6842e8229076cb6cf62f11eed3747d"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: PasswordSignInForm.tsx \u2194 SignUp.tsx: \u0060web/src/components/PasswordSignInForm.tsx\u0060 and \u0060web/src/pages/SignUp.tsx\u0060 change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/PasswordSignInForm.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1517229d260667c91d752cfe6d270ebd23311112bafe0e4c957e9b39ae194b"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: constants.ts \u2194 index.tsx: \u0060web/src/components/MemoContent/constants.ts\u0060 and \u0060web/src/components/MemoContent/index.tsx\u0060 change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module \u2014 a sibling reference still needs an import \u2014 so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/MemoContent/constants.ts"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f590a9dd1972db26114fd485a6e8a1de533fec11dd37c7a142533f9376ab5f0"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: AttachmentListView.tsx \u2194 LocationDisplayView.tsx: \u0060web/src/components/MemoMetadata/Attachment/AttachmentListView.tsx\u0060 and \u0060web/src/components/MemoMetadata/Location/LocationDisplayView.tsx\u0060 change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"web/src/components/MemoMetadata/Attachment/AttachmentListView.tsx"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8779981f538121028942c9de9bdd60bb1b67c5597b11c9a96178af2081054628"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0e17f71490e4d120a48b2b2881ab866c93b272bef2febb673a3e8e42b2c288ab"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0752d0df7434000fcabf1048e2de30a7a1a8b982b3db9a19898c4dec199856b4"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d657599f6f99da1927d3377533dfc0888b34c4d84aa7d5579841fd72d0e39bce"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5e3545524e8875b4c7eba7c1011fc73f5980286a976278c5029e01d01e301600"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2e713568f92ceba89e04ad04b5d4791a1fa0236e7a475eb8e0d16f0950ff7d67"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"24fcae53239a1ac72bc974dcc3442f0bef6a331b9ed40849b5e99c9cb4cbc05a"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a67f87dbb76735228eb1f84bea26a5ed8636e9e412ed945fe4eee1dd347d973d"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"55550d1f4745417f562e81631d39178febfe5cc4ed85f6304b3477ab43074462"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"131b09f14d68efc89a88205e47e28857c30467b4fde1106ff0b6da8c709696f7"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"fee7fe228b5446cbf9ea82164e3a472a4495e59a569f80f5fe00a385dbc177c5"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"fae6575f67d41133a471db06304b1ab1fa754a3a7cac7b439846855eb8d2f84c"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"adba530543fd28e20fb5ae77e7d88a60dd406542b9de5956bf12a60fc313739a"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c3101d36131a52584dde37b042bdfe9fc6a1d1edad6398c91ef166385743b007"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c8e6740321a9758be2667eea6842293616ba35402441f8df0a0ca2a8f6a5fa68"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ba0695644397eab358c67149e6d936cb8b6b648c1f9c8b9bfa34a8138855768a"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"be217444638ac33aa1bd5044cfc99a2e92b284c1cc1654e8220d2ef2ef47944d"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"231ad4dc838e4a2768e6f7a1e67ca410b16632a9e046ea516d551978147d4308"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7a391da947a4fe3d7e8a122f4368775cd9c73d5e0e9d4fd0a0d7a739f7f0e073"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f3829ecb04e9d41cea698029c2d83e97970be2c6f5ee3e406e1d543f8095967e"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"892cda7f83ebfb93e9ad0224ff14ec802ff9a524bf3c2218a344bb243d501db5"}},{"ruleId":"D38","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9905417713481be5e95420535f03daae88e3f1dbb1b5e7de84273ed317f0377d"}},{"ruleId":"D38","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"cb45bc7eb13250db17eee2ad2aa08bb08b27c7f2d15b63212fcdad2e99594644"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1032","guid":"5f21e517-68aa-a650-9a25-5771ef024637","name":"OWASP Top Ten \u2014 Security Misconfiguration category","shortDescription":{"text":"OWASP Top Ten \u2014 Security Misconfiguration category"},"helpUri":"https://cwe.mitre.org/data/definitions/1032.html"},{"id":"CWE-1059","guid":"a2381a08-60f6-9554-a8b8-f3018cfaaca5","name":"Insufficient Technical Documentation","shortDescription":{"text":"Insufficient Technical Documentation"},"helpUri":"https://cwe.mitre.org/data/definitions/1059.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-16","guid":"659db3ea-affc-8453-8add-c1218fbfcb92","name":"Configuration","shortDescription":{"text":"Configuration"},"helpUri":"https://cwe.mitre.org/data/definitions/16.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-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-732","guid":"1da27e8f-b330-7650-ab63-bd61953eae5d","name":"Incorrect Permission Assignment for Critical Resource","shortDescription":{"text":"Incorrect Permission Assignment for Critical Resource"},"helpUri":"https://cwe.mitre.org/data/definitions/732.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":31,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}