{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"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":"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":"eventbus.AcceptanceTest (cyclomatic 47): eventbus.AcceptanceTest has cyclomatic complexity 47 (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":"eventbus/acceptance_testing.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b0e6322ec048ae2955cf239c17760b83080ce06177548df7ea3c33239cee402"}},{"ruleId":"D1","level":"warning","message":{"text":"eventstore.AcceptanceTest (cyclomatic 27): eventstore.AcceptanceTest 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":"eventstore/acceptance_testing.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab5f953a978dfc0a793ea10344d40f4425c41d1e0d368b453f015e66d31b5466"}},{"ruleId":"D1","level":"warning","message":{"text":"Aggregate.HandleCommand (cyclomatic 27): Aggregate.HandleCommand 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":"examples/todomvc/backend/domains/todo/aggregate.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"830be957461dfe333029c936ea9ce31a8173da5094eaf64fb2276406162fd529"}},{"ruleId":"D1","level":"warning","message":{"text":"repo.AcceptanceTest (cyclomatic 27): repo.AcceptanceTest 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":"repo/acceptance_testing.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"01dfb08bcac5c5f28128b66b3cfa36b080e50ba4a078f8cf41aa1ec8c7b9027c"}},{"ruleId":"D1","level":"warning","message":{"text":"EventHandler.HandleEvent (cyclomatic 25): EventHandler.HandleEvent 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":"eventhandler/projector/eventhandler.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"fed4111d828ca4d8c0c1fa5df35bd4d7576ce2ba9dbb28c913a4bc927b7f1e8a"}},{"ruleId":"D1","level":"warning","message":{"text":"outbox.AcceptanceTest (cyclomatic 25): outbox.AcceptanceTest has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/acceptance_testing.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f01ab9db804972022e1589002613dfcc102c8adcb1f5fc3827bdbdb94bf7caf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 23): main.main has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 3 belong to 3 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":"examples/todomvc/backend/main.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"48d267606fffbd90f5e408a50362783ca25549671ee62dd463ea139f7fc74285"}},{"ruleId":"D1","level":"warning","message":{"text":"EventStore.Save (cyclomatic 21): EventStore.Save has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/mongodb/eventstore.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bd390b95875a892fbb52f77e2777db4c7040e873fe79273a3a97b1969ef5762"}},{"ruleId":"D1","level":"warning","message":{"text":"eventstore.MaintenanceAcceptanceTest (cyclomatic 19): eventstore.MaintenanceAcceptanceTest 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":"eventstore/maintenance_testing.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"1388f26e98c5bc15ca904f240a9b315afe7c084b36f154bf6b51e97b2572aedb"}},{"ruleId":"D1","level":"warning","message":{"text":"EventStore.saveInTX (cyclomatic 18): EventStore.saveInTX has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 393). 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":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e6766ba86542b82db7c5b2faaf093b6d28abf3817d68dd0e2e34cc50a7fae5a"}},{"ruleId":"D1","level":"warning","message":{"text":"InvitationAggregate.HandleCommand (cyclomatic 18): InvitationAggregate.HandleCommand 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":"examples/guestlist/domains/guestlist/aggregate.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbc452eac0987bd32aee64c1f0d67ff71b6c7e890b32b31dc78034b9878565f9"}},{"ruleId":"D1","level":"warning","message":{"text":"Projector.Project (cyclomatic 18): Projector.Project 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":"examples/todomvc/backend/domains/todo/projector.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"777577b19fcdfa1a321cd06ed4d6ea1d9454951a96263317a9df756016a1c9b6"}},{"ruleId":"D1","level":"warning","message":{"text":"eventhorizon.CompareEvents (cyclomatic 17): eventhorizon.CompareEvents 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":"compare.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"2941ac2405a7c239b88e21fd0a00dc134a813d8bea4d4b2bdb43e4921d255afb"}},{"ruleId":"D1","level":"warning","message":{"text":"Aggregate.ApplyEvent (cyclomatic 17): Aggregate.ApplyEvent 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":"examples/todomvc/backend/domains/todo/aggregate.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdf1c54ffb1a78338bdd0e8a9e75e3cdbee80f2074107cdfcb7c5c24fb3e1414"}},{"ruleId":"D1","level":"warning","message":{"text":"bson.newUUIDRegistry (cyclomatic 16): bson.newUUIDRegistry has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 73, 52). 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":"codec/bson/uuid.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"62cddd8e30257e20fd3c20103248eba44e9ab2adf26459dc31669049dfefacbc"}},{"ruleId":"D2","level":"warning","message":{"text":"eventbus.AcceptanceTest (cognitive 51): eventbus.AcceptanceTest has cognitive complexity 51 (threshold 15). Drivers by points: if/else 40, boolean chains 8, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/acceptance_testing.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a26690bd58f97ff1c2f9dd8816cab57c8f392845f396725961c017a8750cd58"}},{"ruleId":"D2","level":"warning","message":{"text":"Aggregate.HandleCommand (cognitive 45): Aggregate.HandleCommand has cognitive complexity 45 (threshold 15). Drivers by points: if/else 33, loops 10, match/switch 2 (nesting depth added 26). 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":"examples/todomvc/backend/domains/todo/aggregate.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fb9bacb780399fe006152adb8d71e0ae208affac09bea0d985f47d074fe0105"}},{"ruleId":"D2","level":"warning","message":{"text":"EventHandler.HandleEvent (cognitive 38): EventHandler.HandleEvent has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, boolean chains 4, jumps 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventhandler/projector/eventhandler.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"3baa91dbe16a87dfd3ffe57c6619e330628f5da7a8c724c885b972e2f8486e68"}},{"ruleId":"D2","level":"warning","message":{"text":"EventStore.Save (cognitive 38): EventStore.Save has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, loops 5 (nesting depth added 16). Of this number, 24 points are the body\u0027s own statements and 14 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/mongodb/eventstore.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecb9a303a200f28f1de0eea69a72f9a63726450adcbd889ae86f1d739f0ecfa3"}},{"ruleId":"D2","level":"warning","message":{"text":"EventBus.handle (cognitive 32): EventBus.handle has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 17, if/else 12, loops 3 (nesting depth added 19). Of this number, 31 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"eventbus/kafka/eventbus.go"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"16f9c7c86d3b31869acbead2b94bbdecedc62352da94941629b0e2d85611e4cd"}},{"ruleId":"D2","level":"warning","message":{"text":"eventstore.AcceptanceTest (cognitive 30): eventstore.AcceptanceTest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/acceptance_testing.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bc64ada4ccc2846904dce9aff0d64ee12703a149acd47421b16672d0e07862"}},{"ruleId":"D2","level":"warning","message":{"text":"EventStore.saveInTX (cognitive 27): EventStore.saveInTX has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 3 (nesting depth added 9). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 393). 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":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"000479beae81d9b448312869b93718748b7f0100c85f3933edc1c850f2bef148"}},{"ruleId":"D2","level":"warning","message":{"text":"Outbox.processOutboxEvent (cognitive 26): Outbox.processOutboxEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 6, match/switch 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/memory/outbox.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"5278ea68996327e9fd8c422772e7d79887a18d05f6c939e3f128d547bc549c8b"}},{"ruleId":"D2","level":"warning","message":{"text":"repo.AcceptanceTest (cognitive 26): repo.AcceptanceTest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"repo/acceptance_testing.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"4577b2c45a575723bbd56f48929c83ba3a78c819d25cd4b9081982cfecb9e73f"}},{"ruleId":"D2","level":"warning","message":{"text":"eventhorizon.CompareEvents (cognitive 25): eventhorizon.CompareEvents has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, 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":"compare.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe606f7d91f8d7f97e7e97829b45a7303b515f8a3701ee32b1f32186f331b711"}},{"ruleId":"D2","level":"warning","message":{"text":"Projector.Project (cognitive 25): Projector.Project has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 6, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/todomvc/backend/domains/todo/projector.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"3526271b270c1b11b37466283a942b49d26ca00d240644b6d6ebae134f8d0490"}},{"ruleId":"D2","level":"warning","message":{"text":"Outbox.outbox (cognitive 25): Outbox.outbox has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10, match/switch 9, loops 6 (nesting depth added 17). Of this number, 13 points are the body\u0027s own statements and 12 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":"namespace/outbox.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"32991586d92513bcfa7c1a4d450bb868861eea5b9272b888884efb327f56e968"}},{"ruleId":"D2","level":"warning","message":{"text":"outbox.AcceptanceTest (cognitive 25): outbox.AcceptanceTest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/acceptance_testing.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3f1c15108386d16db786835ca335904e2a01987466bdc0e57f0520a6e0261cf"}},{"ruleId":"D2","level":"warning","message":{"text":"Aggregate.ApplyEvent (cognitive 24): Aggregate.ApplyEvent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 6, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/todomvc/backend/domains/todo/aggregate.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"87d75bbb56a2cc691a91cf50247a9195814db554a1ba44077a44d6aa7e84933a"}},{"ruleId":"D2","level":"warning","message":{"text":"InvitationAggregate.HandleCommand (cognitive 23): InvitationAggregate.HandleCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, 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":"examples/guestlist/domains/guestlist/aggregate.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"b48ecb842449040200d2367a7436ac49160413d5a674bfc3977e5c6bc2806076"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 22): main.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 2. Of this number, 19 points are the body\u0027s own statements and 3 belong to 3 function literals inside it that branch. 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":"examples/todomvc/backend/main.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"d801142139c0a14a850ce0017719b2a0b05ae26644978134433a1ebb17df0866"}},{"ruleId":"D2","level":"warning","message":{"text":"EventStore.Save (cognitive 21): EventStore.Save has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"31953ac917dc3d6e11f68ea86467e27170dd8bbb304be59daa65f7108a05ed68"}},{"ruleId":"D2","level":"warning","message":{"text":"Outbox.processOutboxEvent (cognitive 21): Outbox.processOutboxEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, match/switch 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/mongodb/outbox.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d4d761b6b4e37460b09f6bbc8121e5cd9aaa1b35900fa12850711a7bb31664"}},{"ruleId":"D2","level":"warning","message":{"text":"EventBus.handle (cognitive 20): EventBus.handle has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 10, if/else 9, loops 1 (nesting depth added 13). 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":"eventbus/local/eventbus.go"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"479994ed0fb3328bed9b2fe137e9cf419312356b946d59f25329e5bf2e425cb4"}},{"ruleId":"D2","level":"warning","message":{"text":"eventstore.MaintenanceAcceptanceTest (cognitive 20): eventstore.MaintenanceAcceptanceTest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"eventstore/maintenance_testing.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"c54de047f54446dc353fe9253e3e1a52b4c3a3b3a1ff6400d28785f4d256ce22"}},{"ruleId":"D2","level":"warning","message":{"text":"EventHandler.run (cognitive 19): EventHandler.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, match/switch 7, loops 4, 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":"eventhandler/waiter/eventhandler.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"972b64764dc7b146c26a0be5a8484ecf64471271b0d12d255ff2dffdc86dfb17"}},{"ruleId":"D2","level":"warning","message":{"text":"Scheduler.run (cognitive 19): Scheduler.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, match/switch 5, jumps 1, loops 1 (nesting depth added 12). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 310). 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":"middleware/commandhandler/scheduler/middleware.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"b28a06d3ed7dd41d4d81e5d7e0a8e938ed766fa3e76152ed97c51dcc8c57e376"}},{"ruleId":"D2","level":"warning","message":{"text":"EventBus.handler (cognitive 18): EventBus.handler has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 11, if/else 7 (nesting depth added 7). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 243). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/redis/eventbus.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3b69a681a89368fc0fc571a8d434528b5fb96da4c060c3d6bb03d5984bb1a2a"}},{"ruleId":"D2","level":"warning","message":{"text":"eventbus.benchmark (cognitive 17): eventbus.benchmark has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 6, match/switch 3 (nesting depth added 7). Of this number, 9 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/acceptance_testing.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8beff42a6c4fbf2d8ea7c6d4718dba3898cb510f7ececf4d60fe7c84e00f27c"}},{"ruleId":"D2","level":"warning","message":{"text":"EventStore.save (cognitive 17): EventStore.save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/memory/eventstore.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf1668386382e81798f1f85d8bc31b71c4db31ae521ecbf5ec5f91fd7e1162ac"}},{"ruleId":"D2","level":"warning","message":{"text":"eventhorizon.isZero (cognitive 16): eventhorizon.isZero has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"command_check.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b4cc0c212bd0cbb5d0323ca7bdac4ec45f9a453c8c6b418b1d60a6dea81f1ed"}},{"ruleId":"D2","level":"warning","message":{"text":"bson.newUUIDRegistry (cognitive 16): bson.newUUIDRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 73, 52). 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":"codec/bson/uuid.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"f38b2b1133897d42d903334aec885838e84a6067c7c9551320e86b63e361df72"}},{"ruleId":"D2","level":"warning","message":{"text":"gcp.NewEventBus (cognitive 16): gcp.NewEventBus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/gcp/eventbus.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"1275c1765b305808d517a9b328eae9a7daa5bea9d1b7394c866f7498f06504f8"}},{"ruleId":"D2","level":"warning","message":{"text":"outbox.Benchmark (cognitive 16): outbox.Benchmark has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, loops 6, match/switch 3 (nesting depth added 7). Of this number, 8 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/performance_testing.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"db0c4531ff0d1a40c4562cc6f86e38ba2542d8b9bad5638d788b05ecf7e41b0a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mongodb_v2/eventstore.go: FileTooLong \u2014 574 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb39c5149e4a52adaa4902ddd65bc390e30a2d759d3d787ab1776eaa19e9c602"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): outbox/memory/graceful.go:43-66 | outbox/mongodb/graceful.go:43-66 \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 \u0060outbox/memory/graceful.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/memory/graceful.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"69c7c17a5e472c029b1145a25e8336b22fd2b98990b92f9338d382464edf296e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): eventbus/acceptance_testing.go:345-367 | outbox/performance_testing.go:57-79 \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 \u0060eventbus/acceptance_testing.go:345\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":"eventbus/acceptance_testing.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cd775123d6052077fe502257050b8530a0f1c022a589e30d8b0ecc9092fde0d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 3): eventstore/memory/eventstore.go:111-129 | eventstore/mongodb/eventstore.go:179-197 | eventstore/mongodb_v2/eventstore.go:306-324 \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 \u0060eventstore/memory/eventstore.go:111\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":"eventstore/memory/eventstore.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"bafe4c13fa441d9c5142e8f3912b1cd4fca3e5378372b2537984b77d2e1fbacb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): eventstore/mongodb/eventstore.go:372-390 | eventstore/mongodb_v2/eventstore.go:679-697 \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 \u0060eventstore/mongodb/eventstore.go:372\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":"eventstore/mongodb/eventstore.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa0bdaba84f0a82540467d2229f8b65ebb2ef735f9003456c3b67a8e69b6e525"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 5): eventbus/gcp/eventbus.go:184-201 | eventbus/kafka/eventbus.go:282-299 | eventbus/local/eventbus.go:103-120 | eventbus/nats/eventbus.go:163-180 | eventbus/redis/eventbus.go:147-165 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/gcp/eventbus.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"a36a81448f7b3c61d13241c58361ecde21012259230047904b2df4ca244eb86e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): codec/bson/event.go:86-103 | codec/json/event.go:84-101 \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":"codec/bson/event.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"541f644662ecabdbd19aea83fe15f5a9d453e06ac01e80bcf20d3b1fef78c6ec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): eventbus/gcp/eventbus.go:65-82 | eventbus/nats/eventbus.go:60-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 \u0060eventbus/gcp/eventbus.go:65\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":"eventbus/gcp/eventbus.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"284a5beec8518c2050fd58b1d64317524ba4510cbd2b061a31d6a1f03334c19f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): eventstore/mongodb_v2/eventstore.go:474-491 | eventstore/mongodb_v2/eventstore.go:563-580 \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 \u0060eventstore/mongodb_v2/eventstore.go:474\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":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"d614b1d45b6992c3c5465da88461ab820050ee64c4ca87a27f29e3daadab2813"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): outbox/memory/outbox.go:183-200 | outbox/mongodb/outbox.go:263-280 \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 \u0060outbox/memory/outbox.go:183\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":"outbox/memory/outbox.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"b27bb698878e839ea8bb4fa5db917a4a38818de484346c6c418198a155703f81"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 3): namespace/outbox.go:91-106 | outbox/memory/outbox.go:73-88 | outbox/mongodb/outbox.go:155-170 \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 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":"namespace/outbox.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"76ad3d802190ab032578d3e3bd88f94ff2f79d6690fe33fbbfd3c294fc6cca51"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): repo/acceptance_testing.go:81-95 | repo/acceptance_testing.go:133-147 \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 \u0060repo/acceptance_testing.go:81\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"repo/acceptance_testing.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"58844f4af75e66339915ea800b43c5d15ba0b24af52ba6f7d7974152baf78dbf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): eventstore/mongodb/eventstore.go:262-275 | eventstore/mongodb_v2/eventstore.go:380-393 | eventstore/mongodb_v2/eventstore.go:532-545 \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 \u0060eventstore/mongodb/eventstore.go:262\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":"eventstore/mongodb/eventstore.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"d692ae2f01bd26303cf178955091142ffc9427a457a93eb43ef17741e3cebe83"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): codec/acceptance_testing.go:62-75 | codec/acceptance_testing.go:147-160 \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 \u0060codec/acceptance_testing.go:62\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":"codec/acceptance_testing.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"85dc1fad5c8cc87bbb9b38a7918147428f02ec6fd812b8033a1e8ffbbc70a07c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): eventbus/nats/eventbus.go:58-71 | eventbus/redis/eventbus.go:57-70 \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 \u0060eventbus/nats/eventbus.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":"eventbus/nats/eventbus.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"e776d34dee7c67d7f38b30dac93e72f44a1ab8275aa66138f982aa406267ee62"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): eventstore/memory/eventstore.go:259-272 | outbox/memory/outbox.go:302-315 \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 \u0060eventstore/memory/eventstore.go:259\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":"eventstore/memory/eventstore.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"709c50a264222f3d4aaadfdb5786a85b5e3b5eb15d6b0ab99d2058013ffc8856"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): repo/mongodb/repo.go:239-252 | repo/mongodb/repo.go:273-286 \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 \u0060repo/mongodb/repo.go:239\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":"repo/mongodb/repo.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"786425a304eff6830aea58afe775c303064d31d3ded901248b8e121cf856f1c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): aggregate.go:101-113 | eventstore.go:103-115 \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 \u0060aggregate.go:101\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":"aggregate.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"84a213eaa933199e44f21f360ef0af780f3a388d7e35063eb111e4921470d452"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): eventstore/acceptance_testing.go:178-190 | eventstore/maintenance_testing.go:94-106 \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 \u0060eventstore/acceptance_testing.go:178\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":"eventstore/acceptance_testing.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c5f899a64788fb13a1ac13fae030ef13e7dccf34a32c16e29f21a8464a2d587"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): outbox/acceptance_testing.go:132-143 | outbox/acceptance_testing.go:150-161 \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 \u0060outbox/acceptance_testing.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"outbox/acceptance_testing.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"47608dad769f0c45439b8207c99adac82dc596d28dc80ed1560de95a8fbc8224"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): eventstore/maintenance_testing.go:130-141 | eventstore/maintenance_testing.go:148-159 \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 \u0060eventstore/maintenance_testing.go:130\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":"eventstore/maintenance_testing.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4553ae6eeb446f28ff0e174b523abeedeb2dd61fab79f74f4b6bbedfff2eead"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): codec/bson/event.go:37-48 | codec/json/event.go:36-46 \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 \u0060codec/bson/event.go:37\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":"codec/bson/event.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d58e3a910dbbb7baeac57b054c3e0c3ff180f625ee51c8d8bf5ab979c20d7a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): eventbus/acceptance_testing.go:204-214 | eventbus/acceptance_testing.go:219-229 \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 \u0060eventbus/acceptance_testing.go:204\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":"eventbus/acceptance_testing.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"e037b687749703e0dcc4d6a8e2e7cc4b98aed4c1959b7bd581475130a95ec071"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 4): eventstore/mongodb/eventstore.go:59-68 | eventstore/mongodb_v2/eventstore.go:99-108 | outbox/mongodb/outbox.go:66-75 | repo/mongodb/repo.go:62-71 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 4 times. 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":"eventstore/mongodb/eventstore.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"33a6ef7b44d2a98783229471744aaeaf73d9e972d365b86317f091365da4c09c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): eventbus/acceptance_testing.go:39-48 | outbox/acceptance_testing.go:32-41 \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 \u0060eventbus/acceptance_testing.go:39\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":"eventbus/acceptance_testing.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c4d45903ec5f3ddc500790ef5c2369c5f6c5a62c73a7de0637229f23aa6cea3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): eventstore/acceptance_testing.go:80-91 | eventstore/acceptance_testing.go:93-102 \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 \u0060eventstore/acceptance_testing.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventstore/acceptance_testing.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bb2885c00d16a1044647f9d86263bcfb513e7c8f87d44135deef46bf8dc222f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): eventstore/mongodb/eventstore.go:92-101 | outbox/mongodb/outbox.go:103-112 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060eventstore/mongodb/eventstore.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 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":"eventstore/mongodb/eventstore.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"174869889c1a4f545ed8f08aa7f4a9ac052b63ca4b1b04f8df99abb8b09f2208"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): eventbus/acceptance_testing.go:74-83 | outbox/acceptance_testing.go:65-74 | outbox/acceptance_testing.go:122-130 \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 \u0060eventbus/acceptance_testing.go:74\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":"eventbus/acceptance_testing.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae29077b03eec632378dba67e8a1e6136c191978d674d6ec938aa2c945fcf631"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): eventbus/gcp/eventbus.go:309-317 | eventbus/nats/eventbus.go:275-283 | eventbus/redis/eventbus.go:281-289 \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 \u0060eventbus/gcp/eventbus.go:309\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":"eventbus/gcp/eventbus.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ae103befe765955b6468607624969520ef79c9d06ad402fe09bb9c59032d774"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): codec/bson/command.go:56-64 | codec/json/command.go:53-61 \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 \u0060codec/bson/command.go:56\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":"codec/bson/command.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"46470d9ad72f90b91956077f18298dfbe221a9c3708311cf282c45d47180c13a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): tracing/eventstore.go:48-56 | tracing/eventstore.go:70-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 \u0060tracing/eventstore.go:48\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":"tracing/eventstore.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"be80fdeade212c0ea343a51cf4788e7c992b46fd28b972ad84bc6f68d4d0dee6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): codec/bson/event.go:67-74 | codec/json/event.go:65-72 \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 \u0060codec/bson/event.go:67\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"codec/bson/event.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"628a28e9244e28d14f5505fa5c6a27d10f73b9a5e64b23b13ffcbeb7f231223f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): eventstore/maintenance_testing.go:108-115 | eventstore/maintenance_testing.go:116-124 \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":"eventstore/maintenance_testing.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"b871f33995d97f8e08221617acf056b69eb2d94ac7f32ea4f31110fff13a6476"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): eventbus/acceptance_testing.go:253-259 | outbox/acceptance_testing.go:179-186 \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 \u0060eventbus/acceptance_testing.go:253\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":"eventbus/acceptance_testing.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"47ecc3eadd70961ef584af7dc28600840d32d342769e08d95472a3c23c36ed7f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): eventbus/gcp/eventbus.go:291-297 | eventbus/nats/eventbus.go:258-264 \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 \u0060eventbus/gcp/eventbus.go:291\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":"eventbus/gcp/eventbus.go"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"4eb0cdad3738551b21ee3373f28a22f19b85c0c57eceea4ea7f6f6cb83ad4b10"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): eventbus/acceptance_testing.go:145-149 | outbox/acceptance_testing.go:121-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 \u0060eventbus/acceptance_testing.go:145\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventbus/acceptance_testing.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"87c8b0313aff344649186854dac03ce19422a51f87542bc38295f7ade872b202"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: eventstore/mongodb_v2/eventstore.go: eventstore/mongodb_v2/eventstore.go changed 2 times in last 90 days, max complexity 18. 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":"eventstore/mongodb_v2/eventstore.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"81eeca4e2d12449d731015edd973ba8d0d71891a0d1379eb0543ff092a4d7275"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 24 significant file(s) lose their only recent owner: mocks/mocks.go, eventbus/acceptance_testing.go, eventbus/kafka/eventbus.go, eventbus/gcp/eventbus.go, eventhandler/projector/eventhandler.go, middleware/commandhandler/scheduler/middleware.go, eventstore/acceptance_testing.go, eventbus/nats/eventbus.go (\u002B16 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"82237c3ce12bce3509cc17f56b57f1c1ee8dae70dc350290e6e76ad99da90ea8"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7dc5db3fb556c21c639c6723ffba8ee9586d32a6587bfd3de87d7f4797dad2e6"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"db572b4b6ebfa4863e9cd49eaf64fa9b025e53e7a748e781dbb52f26b598e054"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"48de7ef42589b8e791c9bbfb8ef9c45e2c46c403d0c718acee2bab1c2000f011"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb0a7a97ba16a809a94c29ae7f33cd752468bb6440dd2e177d5ae0778d8ff84c"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4378ed2b757a859e34a2444e0313f5c1a3c8ed8f667018fb77417d4c5f828cce"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c6d74e717c434dadf44762545d2261902016a0e41bbd0c7f8ba5fc687f531fa3"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"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":"ef764ba7c8727763ba366b37a2cead40dba6a1f1ed6d05e3f172cf94561eeba7"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","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":"19a5039471f9fed215be08f812f73274768e5966225a51b651324a3251fc2d17"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"cc9aaab6a092fbe7bf2b5c3e09dd38345d9b361ff42e70884da7d0421b1a812f"},"taxa":[{"id":"CWE-352","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"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":"c4403595ab79d184f145ed9b7cdf1fe8a888ca1d1c3b58475deee9291eae5166"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 22 of 56 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: eventbus/redis/eventbus.go, aggregatestore/events/aggregatestore.go, namespace/outbox.go (and 19 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":"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":"D37","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":"2baf56be81cee4fea57b9fbc0bcca4df8426c883fe2356827c7e968782d68617"}},{"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":"180098ad28b8ec88ea6d9d65ee5bc15f4d0baa3b9973c6b6be6d625ae224abce"}},{"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":"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":"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":"f4efd88f1a6b253902d467e283e751fcde59296e59c6c983414c4fefcdee5a1a"}}],"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-338","guid":"e89b7604-c3f7-8b53-bc8c-4d4718c28617","name":"CWE-338","shortDescription":{"text":"CWE-338"},"helpUri":"https://cwe.mitre.org/data/definitions/338.html"},{"id":"CWE-352","guid":"2afe7bdb-7330-195f-b3bf-8cf5b789b3ae","name":"CWE-352","shortDescription":{"text":"CWE-352"},"helpUri":"https://cwe.mitre.org/data/definitions/352.html"},{"id":"CWE-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"CWE-353","shortDescription":{"text":"CWE-353"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-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":23,"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."]}]}