{"$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":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"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":"Memory.subscribeToAllEvents (cyclomatic 28): Memory.subscribeToAllEvents has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to one function literal inside it that branches (line 315). 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":"eventlog/memory.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"e936c35580115f8bf23e0609e4ca29cacce984339ef52ab185b5cc48e14b33fd"}},{"ruleId":"D1","level":"warning","message":{"text":"workflow.WaitForEvent (cyclomatic 25): workflow.WaitForEvent 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":"workflow/workflow_events.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"380b0a75fc2d824794f33b756042033e648f756c486a220e45b387d25b5edf4f"}},{"ruleId":"D1","level":"warning","message":{"text":"Workflow.Run (cyclomatic 23): Workflow.Run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"b597233e75611ff6c99d824d4bf2d1a7917154ea013f5ad4fb298fb47885528d"}},{"ruleId":"D1","level":"warning","message":{"text":"WorkflowInstance.Apply (cyclomatic 20): WorkflowInstance.Apply has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"8239ad4939c0f7ab879e8274e6607a849576044b711d3fa9b3d8483f86975115"}},{"ruleId":"D1","level":"warning","message":{"text":"AsyncQueue.Handle (cyclomatic 19): AsyncQueue.Handle has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/queue_async.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"6660d263fe847cb9100acbec5162fe1c719e05daa6b70fda5a0f3580a469e9ff"}},{"ruleId":"D1","level":"warning","message":{"text":"NATS.AppendInTx (cyclomatic 18): NATS.AppendInTx has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventlog/nats.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e9ef06f2daf09121acf87236c929ed9a4fad3e8e4e1b6fbdfc7cf0060e90d05"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 16): main.main has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 92, 79). 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":"examples/7_outbox/main.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ac87d559bbc2ae7240c978583570a0a7b30d2a6a379d98bddfe285eabcc10a1"}},{"ruleId":"D2","level":"warning","message":{"text":"Memory.subscribeToAllEvents (cognitive 54): Memory.subscribeToAllEvents has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30, loops 19, boolean chains 5 (nesting depth added 27). Most of this is not in the body itself: 0 of the 54 points are its own statements and the rest belongs to one function literal inside it that branches (line 315). 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":"eventlog/memory.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e66dcf70c34341c84073d97ff3188f174ecc120cf05d95996d05e4ab537685e"}},{"ruleId":"D2","level":"warning","message":{"text":"workflow.WaitForEvent (cognitive 48): workflow.WaitForEvent has cognitive complexity 48 (threshold 15). Drivers by points: if/else 47, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow_events.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"aec1f5812d22ef086d5d8ee234df9376ee69915d0564b7f264f52840e8b9a6a8"}},{"ruleId":"D2","level":"warning","message":{"text":"Workflow.Run (cognitive 36): Workflow.Run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 36 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b7c001123f14de0e955d932dc11c51a6f5b98eb6f4e6f01f6542a9290407eaf"}},{"ruleId":"D2","level":"warning","message":{"text":"Runner.RunWorker (cognitive 33): Runner.RunWorker has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, match/switch 3, loops 1 (nesting depth added 19). 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":"workflow/worker.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"34107a449248d65fd5bd534d9926a9e4ae9aebbbab7b93d85200b1b3bb0c2529"}},{"ruleId":"D2","level":"warning","message":{"text":"NATS.ReadEvents (cognitive 24): NATS.ReadEvents has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 10). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). 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":"eventlog/nats.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce3d17a20a33d71cbd3f7db67e26ae6e5fc2ae123a423e3bc94bb81699a4beb4"}},{"ruleId":"D2","level":"warning","message":{"text":"NATS.AppendInTx (cognitive 24): NATS.AppendInTx has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 2 (nesting depth added 7). Of this number, 23 points are the body\u0027s own statements and 1 belongs 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":"eventlog/nats.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"09e2cc0004b1a69e14a64bf53fdff77264755d1678d3b524f6ed425d344882ba"}},{"ruleId":"D2","level":"warning","message":{"text":"WorkflowInstance.Apply (cognitive 24): WorkflowInstance.Apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"workflow/workflow.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cded61254c0601b3b83196de32da7c46ec4d6a6145e9f92283f9a7387022336"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 23): main.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 2, match/switch 2 (nesting depth added 9). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 92, 79). 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":"examples/7_outbox/main.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3b5f465955e1a42dc8b5e94b9cc7f7de327371416ed009176ca05b54524320f"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncQueue.Handle (cognitive 20): AsyncQueue.Handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/queue_async.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b12c7a144afb0af1afcb9659c1775928d8890a9b5331e877dfaf679ff549acd"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncProjectionRunner.readAndProcess (cognitive 16): AsyncProjectionRunner.readAndProcess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"event/projection.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab52245b683c2c216dce54596c1de7b6816a298182997ee84350009caf2002d0"}},{"ruleId":"D2","level":"warning","message":{"text":"SQLPrinter.Query (cognitive 16): SQLPrinter.Query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/internal/examplehelper/sql_printer.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"f36d171c3cf9f6061261e2cb0ff6ab9fb827da1337f1861c27400f1504aeec01"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: workflow/workflow.go: FileTooLong \u2014 557 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":"workflow/workflow.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b6d169fe945c8ca7a69541a7c0e4c563abcc27368092efec533039fa1fafd00"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): workflow/queue_async.go:79-100 | workflow/queue_sync.go:87-110 \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 \u0060workflow/queue_async.go:79\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":"workflow/queue_async.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"35c7698ff437dff658518f912f8e7785d5c337a73db802e42dc07171438bdd39"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): workflow/queue_async.go:258-277 | workflow/queue_sync.go:178-196 \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 \u0060workflow/queue_async.go:258\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":"workflow/queue_async.go"},"region":{"startLine":258}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf662083a95fc9d5fdb19f6c5ee1712ad9c5292e3be9ee60d69482745f212eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): eventlog/memory.go:341-357 | eventlog/memory.go:416-432 \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 \u0060eventlog/memory.go:341\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":"eventlog/memory.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8ee7ef8f247943df152fcf5211b4488981cd957a1ec202ffa7a3ae718ab0090"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): eventlog/postgres.go:68-84 | snapshotstore/postgres.go:65-81 \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 \u0060eventlog/postgres.go:68\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventlog/postgres.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"8209e4a488ba537489cde29735399d833a54a9a352134ab63846efe3df777fef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): eventlog/postgres.go:357-373 | eventlog/sqlite.go:335-351 \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 \u0060eventlog/postgres.go:357\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":"eventlog/postgres.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"958adcd37cdd2b3afd793649dbb541aa8e42b685cbba146d7dc42b00587a4120"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): eventlog/postgres.go:241-256 | eventlog/sqlite.go:219-234 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060eventlog/postgres.go:241\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventlog/postgres.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"28a5ac967168adade4591237f796d2997e06a25bc980d53a1916d1a9161d287b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): workflow/queue_async.go:228-243 | workflow/queue_sync.go:146-161 \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 \u0060workflow/queue_async.go:228\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/queue_async.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"210767586b8b64684e05a812c801e0f4b7f748ce2b049bb59ac22004d398fcb1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): eventlog/memory.go:288-302 | eventlog/memory.go:337-351 \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 \u0060eventlog/memory.go:288\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":"eventlog/memory.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff1df9cb0237ba4fa8d592431c4b77145065e3481d2f256ecb81d3fd08870cfb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): eventlog/postgres.go:281-295 | eventlog/sqlite.go:259-273 \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 \u0060eventlog/postgres.go:281\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventlog/postgres.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"50cc803250549f42505c63a609a4124267e99cdce7b8164c251fb475937781e7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): aggregate/repository_transactional.go:68-82 | aggregate/repository_transactional.go:118-131 \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 \u0060aggregate/repository_transactional.go:68\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"aggregate/repository_transactional.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb40458bd661e63222d4ca3e611a4020ac038dd593a9edf54cc8dbf18bbb3e52"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): eventlog/postgres.go:203-218 | eventlog/sqlite.go:183-196 \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 \u0060eventlog/postgres.go:203\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":"eventlog/postgres.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"0705f96ee4fecd5b4d49af0fe1b2187e4c890b6b5dd5f13def97421bd2c54aa4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): examples/3_snapshots/main.go:47-66 | examples/5_event_metadata/main.go:62-74 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"examples/3_snapshots/main.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3c6a5beb91c73a34a5e865ca0edf678ab5c24ee6965b9888a54241dda637ab7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): examples/internal/account/account.go:72-84 | examples/internal/accountv2/account.go:84-96 \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 \u0060examples/internal/account/account.go:72\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"examples/internal/account/account.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"a84c46b3312d1b57bac2372c34087ff25db8449ea94fabed32dd08f603b01b26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): eventlog/memory.go:86-98 | eventlog/postgres.go:118-129 | eventlog/sqlite.go:124-135 \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 \u0060eventlog/memory.go:86\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eventlog/memory.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"2258dce2964b9df81fa512bb3d14149d45034271a3651e7aa3d09677f216756a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): internal/testutils/eventlogs.go:64-73 | internal/testutils/eventlogs.go:119-128 | internal/testutils/eventlogs.go:153-162 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutils/eventlogs.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"be8492835f0577cd76d229ad4a7538602ce6234cf425fc6c5d97ef33d9f14b81"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): eventlog/memory.go:274-283 | eventlog/memory.go:323-332 \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 \u0060eventlog/memory.go:274\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":"eventlog/memory.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"812d0c438899c0b215cdfcf6d35cd9d99d44b4e6fda0890b10ca49417f8b50e4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): examples/6_projections/main.go:48-57 | examples/8_unique_constraint/main.go:95-104 \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 \u0060examples/6_projections/main.go:48\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":"examples/6_projections/main.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"4daa31b86230d88b5d438ba24645f4f4d1186576a328a9e22ef49b18a0d69e91"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): workflow/workflow.go:259-268 | workflow/workflow.go:360-369 \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 \u0060workflow/workflow.go:259\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":"workflow/workflow.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8d64b1e9e27fae12fc2dea1ab29b5fd1a4f58799d4323bcd97228bf9c3d87e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): aggregate/aggregate.go:394-403 | aggregate/aggregate.go:444-452 \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 \u0060aggregate/aggregate.go:394\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"aggregate/aggregate.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"70f6b90aca00ce75336807ae8eecffc7070a18e88dc5b062d170d80f835c4549"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): eventlog/postgres.go:148-156 | eventlog/sqlite.go:153-162 \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 \u0060eventlog/postgres.go:148\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":"eventlog/postgres.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2e61188374f6dd57abd5b124832937f5a333f5ceabec3408477cce33b1cd5f6"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: workflow/workflow_events.go: workflow/workflow_events.go changed 3 times in last 90 days, max complexity 25. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow_events.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4a6c872e9b36b5d9d2aa372480ac5daf27c58ff8f7d21eb2d981f8ab5291a8b"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: workflow/workflow.go: workflow/workflow.go changed 3 times in last 90 days, max complexity 23. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/workflow.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2080fcc706bf9538a81f46ee96819d67b72a0ede48e7a92c327f610e8172429"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: workflow/queue_async.go: workflow/queue_async.go changed 2 times in last 90 days, max complexity 19. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/queue_async.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a72bf58a3729554dbcb92aa6ad4722c1848c510f0c346613ae017f04ce39b06f"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: workflow/worker.go: workflow/worker.go changed 2 times in last 90 days, max complexity 15. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"workflow/worker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"56133bac3a4f7b8da852338ccfef696bd7613394e8a8926bc7d2bf6b9c260f8b"}},{"ruleId":"D16","level":"note","message":{"text":"Small-team knowledge concentration: 31 file(s) are concentrated to one author \u2014 the ambient state with 2 active author(s), not 31 separate risks. The signal becomes meaningful as ownership spreads; no per-file action implied now."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"8aa75b6daa18f1b578387fa04036c50b3163d47f957c8f5601bf083ed4489b0c"}},{"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":"5024c6afc6d3ad433fe6e9d6331e96e5f5c40a20c3a6565c4288cd0d4af79e78"}},{"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":"4b6b5d2627573c9a1561f1157a2d7fa44a4a439ad87ae1369661568fedaa7b18"}},{"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":"d8e0ec1fef71a3e724dfbc0369a1ab7fd2ea030d16ad885c1a104e758f1eac5f"}},{"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":"2492c3c0cb2c02557f01735f6b230f7415d7f8719c979b96bd81861d6f923ef1"}},{"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":"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":"626e01eacf94c3b3382809ff8a91277880813d4497b12c2cdcf28b0d8c94458b"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-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":10,"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."]}]}