{"$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":"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":"Policy.validate (cyclomatic 124): Policy.validate has cyclomatic complexity 124 (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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2328}}}],"partialFingerprints":{"codehealthFindingId/v1":"32bb8eed8755474c6a70e0becac5e7e6dadece0c7620fec2d6bf2a297589328c"}},{"ruleId":"D1","level":"warning","message":{"text":"db.NewHeadscaleDatabase (cyclomatic 100): db.NewHeadscaleDatabase has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 9 of the 100 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 248, 606, 846, \u2026). 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":"hscontrol/db/db.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e4f21647ab0798f96084f9ce291f53ab17f94f01ea72e2161a085ebe7a4e77b"}},{"ruleId":"D1","level":"warning","message":{"text":"State.HandleNodeFromPreAuthKey (cyclomatic 60): State.HandleNodeFromPreAuthKey has cyclomatic complexity 60 (threshold 15). Of this number, 45 points are the body\u0027s own statements and 15 belong to 3 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":"hscontrol/state/state.go"},"region":{"startLine":2458}}}],"partialFingerprints":{"codehealthFindingId/v1":"78964d78659708a9bf7a446d407d08970267df252e6e2aa95ef06ac7e32327ac"}},{"ruleId":"D1","level":"warning","message":{"text":"Policy.compileSSHPolicy (cyclomatic 47): Policy.compileSSHPolicy has cyclomatic complexity 47 (threshold 15). Of this number, 41 points are the body\u0027s own statements and 6 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":"hscontrol/policy/v2/filter.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"94275daa270dee155dc99e36ff7b9bdc4dea4c4dca6003218cd24efe37a171c2"}},{"ruleId":"D1","level":"warning","message":{"text":"PolicyManager.ViaRoutesForPeer (cyclomatic 46): PolicyManager.ViaRoutesForPeer has cyclomatic complexity 46 (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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1191}}}],"partialFingerprints":{"codehealthFindingId/v1":"f58d254288c1e2759a1d567e93310c1de960c8f5fbe57a42f6df99a595016250"}},{"ruleId":"D1","level":"warning","message":{"text":"main.runTestContainer (cyclomatic 40): main.runTestContainer has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/docker.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6893fbeca848290a05b8055e9a368523849287ce6338bea31eb5e7c0d3cbd79"}},{"ruleId":"D1","level":"warning","message":{"text":"hsic.New (cyclomatic 38): hsic.New has cyclomatic complexity 38 (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":"integration/hsic/hsic.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"56ac6ecf25d09fb681d34c64236f8237011c9759ea95cfcf03c3b4202d3461a8"}},{"ruleId":"D1","level":"warning","message":{"text":"Headscale.Serve (cyclomatic 37): Headscale.Serve has cyclomatic complexity 37 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/app.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9c50210a0bd063cb9a38bcd7c36153c167b971f026fccbcbf4dcfd499f30570"}},{"ruleId":"D1","level":"warning","message":{"text":"tsic.New (cyclomatic 33): tsic.New has cyclomatic complexity 33 (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":"integration/tsic/tsic.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"7477758eb8a1ae3c1572bda8ebf9fca8d42be7b75c67a8c2b5413fca7907c967"}},{"ruleId":"D1","level":"warning","message":{"text":"State.UpdateNodeFromMapRequest (cyclomatic 32): State.UpdateNodeFromMapRequest has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 3054). 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":"hscontrol/state/state.go"},"region":{"startLine":3032}}}],"partialFingerprints":{"codehealthFindingId/v1":"63337cc391e94ca961ddbe96ab14d102755646f6cb0324ffaf1bdf9af5a8db41"}},{"ruleId":"D1","level":"warning","message":{"text":"integration.requireAllClientsOnlineWithSingleTimeout (cyclomatic 32): integration.requireAllClientsOnlineWithSingleTimeout has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to one function literal inside it that branches (line 204). 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":"integration/helpers.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa6c7ebf62bc7836391d3b293bfa50080f3798fd6d2dce7d8e8c79c9af947bcd"}},{"ruleId":"D1","level":"warning","message":{"text":"State.applyAuthNodeUpdate (cyclomatic 30): State.applyAuthNodeUpdate has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1748, 1862). 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":"hscontrol/state/state.go"},"region":{"startLine":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"36a33bbae9e766d94875d9c99b57edea8cc6eb5e33cccd6b2ddeb915c4566266"}},{"ruleId":"D1","level":"warning","message":{"text":"util.ParseTraceroute (cyclomatic 29): util.ParseTraceroute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/util/util.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"bce334c26aa60dd2686c398748c1291c8a8c95dc66a732a2dbfc03bf67084d95"}},{"ruleId":"D1","level":"warning","message":{"text":"AuthProviderOIDC.OIDCCallbackHandler (cyclomatic 26): AuthProviderOIDC.OIDCCallbackHandler has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/oidc.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"62d7d755f610adebfb2a6d747d96d51105e9f102e1152019f9be19b2bd3ff9ed"}},{"ruleId":"D1","level":"warning","message":{"text":"PolicyManager.SSHCheckParams (cyclomatic 26): PolicyManager.SSHCheckParams has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"553c8e889ab8d4ab085854375ac4f260b0fe255e68a06891647a173863c77bf8"}},{"ruleId":"D1","level":"warning","message":{"text":"State.createAndSaveNewNode (cyclomatic 26): State.createAndSaveNewNode has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. 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":"hscontrol/state/state.go"},"region":{"startLine":1890}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c98fd9bf2a504eafbea54cabf9cb3f59e7c9d193efce8e58895a0575180a44d"}},{"ruleId":"D1","level":"warning","message":{"text":"types.validateServerConfig (cyclomatic 26): types.validateServerConfig has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/types/config.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"882cb54a368d324c7abe13095c80e55791b3b690a7a184f6ef057945f69ca43a"}},{"ruleId":"D1","level":"warning","message":{"text":"Headscale.scheduledTasks (cyclomatic 25): Headscale.scheduledTasks has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/app.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c08e169807ba18a20b0b81ac8d1f6f7d827aa8c8eee1dab9c5d572d3d4793e0"}},{"ruleId":"D1","level":"warning","message":{"text":"NodeStore.applyBatch (cyclomatic 25): NodeStore.applyBatch 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":"hscontrol/state/node_store.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"74272e362678157ff1f4675e8ed9946ab6119608056893ea6eab1ff4426fa060"}},{"ruleId":"D1","level":"warning","message":{"text":"apiv2.registerKeys (cyclomatic 24): apiv2.registerKeys has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 167, 262, 217, \u2026). 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":"hscontrol/api/v2/keys.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fe44fcbd5e8f5050c34c99d9c9a7a77693ddb8a01ff0a045d3f1772c032b4b8"}},{"ruleId":"D1","level":"warning","message":{"text":"apiv2.registerDevices (cyclomatic 23): apiv2.registerDevices has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 251, 297, 330, \u2026). 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":"hscontrol/api/v2/devices.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5b486b4dd956f159b3da97d4f60ca442c804188bb0890435324aa5cd881dd15"}},{"ruleId":"D1","level":"warning","message":{"text":"State.HandleNodeFromAuthPath (cyclomatic 23): State.HandleNodeFromAuthPath 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":"hscontrol/state/state.go"},"region":{"startLine":2205}}}],"partialFingerprints":{"codehealthFindingId/v1":"795459245e692ba7efa14c6a8f5911fb44d8e9a744722579830ef75012d22f5d"}},{"ruleId":"D1","level":"warning","message":{"text":"hscontrol.NewHeadscale (cyclomatic 22): hscontrol.NewHeadscale has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/app.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d20b0102131b2b3ef84379c2c80c0a4cae68451f8c8a9898a890429b0d7a7c4"}},{"ruleId":"D1","level":"warning","message":{"text":"v2.validateUserReferences (cyclomatic 22): v2.validateUserReferences has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 6 belong to 4 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"3438563372075c02fdf92b53b78b1ea4fe12e8a2ac6a93fd2dbc497262cb0bc0"}},{"ruleId":"D1","level":"warning","message":{"text":"hsic.extractTarToDirectory (cyclomatic 22): hsic.extractTarToDirectory has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/hsic/hsic.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"084b7de45c9fbc4447be56602b220bbc7a8f20b05c605e414e57166d862ff372"}},{"ruleId":"D1","level":"warning","message":{"text":"main.cleanupSuccessfulTestArtifacts (cyclomatic 21): main.cleanupSuccessfulTestArtifacts has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/cleanup.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"1696c801985cc1fae4d45a74fe598c00980f80f3294ecccbe1f3d019ba5da3a1"}},{"ruleId":"D1","level":"warning","message":{"text":"apiv1.registerNodeWriteOps (cyclomatic 20): apiv1.registerNodeWriteOps has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 283, 370, 255, \u2026). 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":"hscontrol/api/v1/nodes.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca1b61214c2bd5899e41b2e57b2743af497b9637a84f1f879b24dd41e5bad68d"}},{"ruleId":"D1","level":"warning","message":{"text":"PolicyManager.BuildPeerMap (cyclomatic 20): PolicyManager.BuildPeerMap has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":606}}}],"partialFingerprints":{"codehealthFindingId/v1":"6542b15d0a38277670be2d365f56a5a04198966371e8f2c718c6a1c0f8d868f1"}},{"ruleId":"D1","level":"warning","message":{"text":"v2.resolveSSHTestDestNodes (cyclomatic 19): v2.resolveSSHTestDestNodes 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":"hscontrol/policy/v2/sshtest.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b1598a7e7091e1b73681ed5596d5f2e25e4e90561d691e654e2f6331186d642"}},{"ruleId":"D1","level":"warning","message":{"text":"v2.validateSSHSrcDstCombination (cyclomatic 19): v2.validateSSHSrcDstCombination 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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2146}}}],"partialFingerprints":{"codehealthFindingId/v1":"0103895195529c4b3a7dc4e2cf8ae0d4a7d1c062e18fc5edefc3e27af38d77c4"}},{"ruleId":"D1","level":"warning","message":{"text":"PolicyManager.invalidateAutogroupSelfCache (cyclomatic 19): PolicyManager.invalidateAutogroupSelfCache has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1491}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b5fbec1c4d5f62a112f368800482e8d1d0afc70989b0781b0f2987ba9795752"}},{"ruleId":"D1","level":"warning","message":{"text":"mapSession.serveLongPoll (cyclomatic 19): mapSession.serveLongPoll has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/poll.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"28936ae9c64f4e758d65e3bd52912e55b73e3863b308edd7c9e616538d8920d7"}},{"ruleId":"D1","level":"warning","message":{"text":"types.LoadServerConfig (cyclomatic 19): types.LoadServerConfig has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. 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":"hscontrol/types/config.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8a2357c432c175097fd685a66e058ebfc2dbc6fe959ecbd614f8b2c5c048565"}},{"ruleId":"D1","level":"warning","message":{"text":"integration.requireAllClientsOfflineStaged (cyclomatic 19): integration.requireAllClientsOfflineStaged has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 432, 406, 382). 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":"integration/helpers.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"3972e348558e7bc891c8afeabd4ea9cdbff4b677de740eed9b7c8aa1e07d1e49"}},{"ruleId":"D1","level":"warning","message":{"text":"Headscale.handleRegister (cyclomatic 18): Headscale.handleRegister 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":"hscontrol/auth.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"462b9ed269c76864a4486a9afbeb6a1b68cd057439b739fb9bb1edc88fd780c2"}},{"ruleId":"D1","level":"warning","message":{"text":"v2.evaluateAssertion (cyclomatic 18): v2.evaluateAssertion 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":"hscontrol/policy/v2/sshtest.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c88d1f9d00b386bfa1951e0ba382080247dd6f3584a6456f6b55dc0284f0a93"}},{"ruleId":"D1","level":"warning","message":{"text":"PolicyManager.updateLocked (cyclomatic 18): PolicyManager.updateLocked has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcb37b0f1f8f0c9e838035f9142afcfb76aba4929f7b5643203e1ac8f63976a7"}},{"ruleId":"D1","level":"warning","message":{"text":"HAHealthProber.ProbeOnce (cyclomatic 18): HAHealthProber.ProbeOnce has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 8 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":"hscontrol/state/ha_health.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"4169e85e6c9cf30d89544467c0a679fb8f4697e0b4375f0e488cd451d9145d4d"}},{"ruleId":"D1","level":"warning","message":{"text":"Change.Merge (cyclomatic 18): Change.Merge has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/types/change/change.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b060b1cb21381c4700348995bc924e1a6619f33715d592fd3d990240a9d6ab1"}},{"ruleId":"D1","level":"warning","message":{"text":"integration.NewScenario (cyclomatic 18): integration.NewScenario 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":"integration/scenario.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"924aa5f30f90374e77e557203daccc477b85ae04ad10eb712d91e6af565c9afb"}},{"ruleId":"D1","level":"warning","message":{"text":"integration.doLoginURLWithClient (cyclomatic 18): integration.doLoginURLWithClient has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":1154}}}],"partialFingerprints":{"codehealthFindingId/v1":"da7b8af195a1d36b1c434e21b88182df603340b7ac5c864156e8535c9c75d8ad"}},{"ruleId":"D1","level":"warning","message":{"text":"apiv1.registerNodeAdminOps (cyclomatic 17): apiv1.registerNodeAdminOps has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 418, 468, 510, \u2026). 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":"hscontrol/api/v1/nodes.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"de7b77de8600f8d8fdaa4ce1a9319c2c9963b4f902aaa081d796fa63c7148f12"}},{"ruleId":"D1","level":"warning","message":{"text":"Batcher.worker (cyclomatic 17): Batcher.worker 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":"hscontrol/mapper/batcher.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"33a00ce419e7eb0bef8a6ca7aeec69e5c4668f2d9d03d539e1f55f7e07959552"}},{"ruleId":"D1","level":"warning","message":{"text":"main.listControlFiles (cyclomatic 16): main.listControlFiles has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/docker.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"0be597235050ace921108216cae7806d58043c99d679bbbdeacbdb6a74d669b5"}},{"ruleId":"D1","level":"warning","message":{"text":"apiv1.registerPolicy (cyclomatic 16): apiv1.registerPolicy 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 3 function literals inside it that branch (lines 111, 63, 169). 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":"hscontrol/api/v1/policy.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b00add66ee277576068eb03cefd42a590d0ba234d9dc6fe2adfeb75277538ec"}},{"ruleId":"D1","level":"warning","message":{"text":"HSDatabase.BackfillNodeIPs (cyclomatic 16): HSDatabase.BackfillNodeIPs 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 one function literal inside it that branches (line 312). 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":"hscontrol/db/ip.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"715d322c63d0c4f2660797ae01b9df6c814965d3b8f3dd9209c04b69206e6832"}},{"ruleId":"D1","level":"warning","message":{"text":"v2.compileAutogroupSelf (cyclomatic 16): v2.compileAutogroupSelf has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":700}}}],"partialFingerprints":{"codehealthFindingId/v1":"afd8d15ff21f00b1305fa07df2c7c54c7be32ae5b415291aaf5e3dc0aab07c9c"}},{"ruleId":"D1","level":"warning","message":{"text":"Groups.UnmarshalJSON (cyclomatic 16): Groups.UnmarshalJSON has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1314}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ed1f61dc16c489c44610808004ddb1919551262adbd70ca1652c4fec59de3ce"}},{"ruleId":"D1","level":"warning","message":{"text":"Policy.compileNodeAttrs (cyclomatic 16): Policy.compileNodeAttrs has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4dfbd4486e9fa754675d5141db7919e88a047fd24bc40b9542ec33afc672da3"}},{"ruleId":"D1","level":"warning","message":{"text":"Change.Type (cyclomatic 16): Change.Type has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/types/change/change.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"97c5ef56854c490a8b686c5cf5996ec38657d39d8ad8c1ae9193b97d8576c400"}},{"ruleId":"D1","level":"warning","message":{"text":"Scenario.ShutdownAssertNoPanics (cyclomatic 16): Scenario.ShutdownAssertNoPanics has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"93bf054f2586f24d5d1f1d76d065e16ff99dc7936a18c06716c546fc932d0a30"}},{"ruleId":"D1","level":"warning","message":{"text":"Scenario.createHeadscaleEnvWithTags (cyclomatic 16): Scenario.createHeadscaleEnvWithTags has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":915}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b8133bfc3a05da6a6dc3dd67ac473344569503282c3d02a7ced4064a2deae40"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.validate (cognitive 284): Policy.validate has cognitive complexity 284 (threshold 15). Drivers by points: if/else 205, loops 42, match/switch 35, boolean chains 2 (nesting depth added 184). 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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2328}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e792bb58709872177b6e5e846c940a04d984ecd4eb2cd38a22430903577f01d"}},{"ruleId":"D2","level":"warning","message":{"text":"db.NewHeadscaleDatabase (cognitive 147): db.NewHeadscaleDatabase has cognitive complexity 147 (threshold 15). Drivers by points: if/else 126, loops 18, boolean chains 3 (nesting depth added 47). Most of this is not in the body itself: 11 of the 147 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 606, 248, 846, \u2026). 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":"hscontrol/db/db.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"247f1f004f17f403a484f5d9783db0257781f2db145c65e22d92d01ea8d9bd46"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.ViaRoutesForPeer (cognitive 124): PolicyManager.ViaRoutesForPeer has cognitive complexity 124 (threshold 15). Drivers by points: if/else 76, loops 41, boolean chains 7 (nesting depth added 78). 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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1191}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8526b914357b01cc21a57818733030f3b309648ec4095a028ac294a5db0af07"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.compileSSHPolicy (cognitive 114): Policy.compileSSHPolicy has cognitive complexity 114 (threshold 15). Drivers by points: if/else 81, loops 23, boolean chains 8, match/switch 2 (nesting depth added 68). Of this number, 105 points are the body\u0027s own statements and 9 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":"hscontrol/policy/v2/filter.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"198a2cd0c423551d349c8b01df7e80b1fcb04d7667d52b0b941ab3a3f5a9dda3"}},{"ruleId":"D2","level":"warning","message":{"text":"State.HandleNodeFromPreAuthKey (cognitive 78): State.HandleNodeFromPreAuthKey has cognitive complexity 78 (threshold 15). Drivers by points: if/else 58, boolean chains 17, loops 3 (nesting depth added 28). Of this number, 52 points are the body\u0027s own statements and 26 belong to 3 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":"hscontrol/state/state.go"},"region":{"startLine":2458}}}],"partialFingerprints":{"codehealthFindingId/v1":"023295b864d39049c96b9557bf8f81daaa9370e2d75f5d1157d6c2ea33a58c57"}},{"ruleId":"D2","level":"warning","message":{"text":"Headscale.Serve (cognitive 67): Headscale.Serve has cognitive complexity 67 (threshold 15). Drivers by points: if/else 62, loops 2, match/switch 2, boolean chains 1 (nesting depth added 28). Of this number, 36 points are the body\u0027s own statements and 31 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":"hscontrol/app.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d816e0969e85996ff9ef422a9e2b96c717837da94acae8f89719508ad2ace9"}},{"ruleId":"D2","level":"warning","message":{"text":"util.ParseTraceroute (cognitive 64): util.ParseTraceroute has cognitive complexity 64 (threshold 15). Drivers by points: if/else 55, loops 7, boolean chains 2 (nesting depth added 35). 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":"hscontrol/util/util.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"db39d856d789e86e0eac843ce4bbed83ba0649c37b42613eae0a73352f4cef5f"}},{"ruleId":"D2","level":"warning","message":{"text":"hsic.New (cognitive 62): hsic.New has cognitive complexity 62 (threshold 15). Drivers by points: if/else 51, loops 9, boolean chains 2 (nesting depth added 23). 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":"integration/hsic/hsic.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f390fb1b245f2688ca567ad31272ef033d9b4f791d8fbe479845c48e5951e74"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runTestContainer (cognitive 60): main.runTestContainer has cognitive complexity 60 (threshold 15). Drivers by points: if/else 49, boolean chains 8, loops 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/docker.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed60cdc4e41b28ba3e338e95b09a9dc52db2ed752840ce4662204a392692c816"}},{"ruleId":"D2","level":"warning","message":{"text":"tsic.New (cognitive 60): tsic.New has cognitive complexity 60 (threshold 15). Drivers by points: if/else 55, boolean chains 2, loops 2, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/tsic/tsic.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"19cac18c9923afc60e668d3f9b74eca342ceac585c2d19c6df6fa2688c358839"}},{"ruleId":"D2","level":"warning","message":{"text":"integration.requireAllClientsOnlineWithSingleTimeout (cognitive 58): integration.requireAllClientsOnlineWithSingleTimeout has cognitive complexity 58 (threshold 15). Drivers by points: if/else 41, loops 13, boolean chains 4 (nesting depth added 25). Most of this is not in the body itself: 0 of the 58 points are its own statements and the rest belongs to one function literal inside it that branches (line 204). 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":"integration/helpers.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"fead1ea3e396d4c6c8495b13377a5d010157350632a475737b0f701b27fa9586"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cleanupSuccessfulTestArtifacts (cognitive 57): main.cleanupSuccessfulTestArtifacts has cognitive complexity 57 (threshold 15). Drivers by points: if/else 52, boolean chains 4, loops 1 (nesting depth added 35). 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":"cmd/hi/cleanup.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfbbb218716fdbb99939229e13d691a0cbe7a45870c9528587799a4ce55fdfb4"}},{"ruleId":"D2","level":"warning","message":{"text":"NodeStore.applyBatch (cognitive 49): NodeStore.applyBatch has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, loops 12, match/switch 2, boolean chains 1 (nesting depth added 29). 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":"hscontrol/state/node_store.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"8775cc5120bb1060264f7a9d4d3ab1f220a0535b1551d872913244eda1533207"}},{"ruleId":"D2","level":"warning","message":{"text":"Batcher.worker (cognitive 46): Batcher.worker has cognitive complexity 46 (threshold 15). Drivers by points: if/else 33, match/switch 6, loops 5, boolean chains 2 (nesting depth added 31). 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":"hscontrol/mapper/batcher.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c6498d5af7f9804545c472dd6b27b557f041f5496de903754fd492322d845f4"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.resolveSSHTestDestNodes (cognitive 46): v2.resolveSSHTestDestNodes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 38, loops 6, boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/sshtest.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"629f13280001bfcae64a8b255a3b601bcdb41cedc4df6cb5818087da66876c72"}},{"ruleId":"D2","level":"warning","message":{"text":"State.UpdateNodeFromMapRequest (cognitive 44): State.UpdateNodeFromMapRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 36, boolean chains 8 (nesting depth added 12). Most of this is not in the body itself: 12 of the 44 points are its own statements and the rest belongs to one function literal inside it that branches (line 3054). 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":"hscontrol/state/state.go"},"region":{"startLine":3032}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2650156066ce27b363e5d7bfd8ba739160ca493d9816e9efd6f36fbd07dd4f4"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.evaluateAssertion (cognitive 42): v2.evaluateAssertion has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31, match/switch 5, jumps 3, loops 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/sshtest.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b4edccd258599d6d15a1b7675dc0b36bd016192ce00663e99fadca7a1fe6c8b"}},{"ruleId":"D2","level":"warning","message":{"text":"hsic.extractTarToDirectory (cognitive 39): hsic.extractTarToDirectory has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, boolean chains 2, loops 2, match/switch 2 (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":"integration/hsic/hsic.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea2d0be8a5f8855685ae00429fb6bee52faf3cef1fb261896965a31e21efc3b0"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.SSHCheckParams (cognitive 38): PolicyManager.SSHCheckParams has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27, boolean chains 7, loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e2ef967415e9058ad0c52ce15337bbab1e01b9d31b651d79d52f409e8fff986"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.invalidateAutogroupSelfCache (cognitive 37): PolicyManager.invalidateAutogroupSelfCache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 34, loops 3 (nesting depth added 18). Of this number, 33 points are the body\u0027s own statements and 4 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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1491}}}],"partialFingerprints":{"codehealthFindingId/v1":"b22d01de58f6e3831d12219e53dd9bdc87c29720112c93114920c2c2e93a5d8c"}},{"ruleId":"D2","level":"warning","message":{"text":"Headscale.scheduledTasks (cognitive 36): Headscale.scheduledTasks has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 5, boolean chains 2, match/switch 2 (nesting depth added 18). Of this number, 29 points are the body\u0027s own statements and 7 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":"hscontrol/app.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"5333bfc531b501f5cb5c2fb56dde5a424a56344e43379d21f9840d1547adeb80"}},{"ruleId":"D2","level":"warning","message":{"text":"Headscale.handleRegister (cognitive 36): Headscale.handleRegister has cognitive complexity 36 (threshold 15). Drivers by points: if/else 34, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/auth.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"f01125f569e378466012697a8bdef5fec42ddfe0c896eb63d071fc45c421c743"}},{"ruleId":"D2","level":"warning","message":{"text":"main.waitForContainerFinalization (cognitive 35): main.waitForContainerFinalization has cognitive complexity 35 (threshold 15). Drivers by points: if/else 29, loops 4, match/switch 2 (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":"cmd/hi/docker.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"d848a5a309346f367ff9016be287d60c51ac10b3978f1f381dedaec669c8fb83"}},{"ruleId":"D2","level":"warning","message":{"text":"hscontrol.NewHeadscale (cognitive 35): hscontrol.NewHeadscale has cognitive complexity 35 (threshold 15). Drivers by points: if/else 32, loops 2, boolean chains 1 (nesting depth added 12). Of this number, 33 points are the body\u0027s own statements and 2 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":"hscontrol/app.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"371bcebcc2e5feadde8ac65eb5d22d247d153db6afedde9f9a0aecabd6cdaadf"}},{"ruleId":"D2","level":"warning","message":{"text":"integration.requireAllClientsOfflineStaged (cognitive 35): integration.requireAllClientsOfflineStaged has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, loops 9, boolean chains 3 (nesting depth added 16). Most of this is not in the body itself: 0 of the 35 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 432, 406, 382). 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":"integration/helpers.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"74c063d5e54c645c1d33901004c4f019ad6958029075f7b939bb52a1bd9fb332"}},{"ruleId":"D2","level":"warning","message":{"text":"integration.NewScenario (cognitive 34): integration.NewScenario has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2432bf7f1e7a6dc44ab8debc7451388110937df64ba0217e6da5f26ffa55d64"}},{"ruleId":"D2","level":"warning","message":{"text":"policyutil.reduceCapGrantRule (cognitive 32): policyutil.reduceCapGrantRule has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, loops 12 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/policyutil/reduce.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf8a275375bd8103fb36e21f05d01f94d79c2abdd4b7543eaf01cecf3dca7368"}},{"ruleId":"D2","level":"warning","message":{"text":"State.applyAuthNodeUpdate (cognitive 32): State.applyAuthNodeUpdate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, boolean chains 7, match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1748, 1862). 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":"hscontrol/state/state.go"},"region":{"startLine":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"c72f40acdb90de410b99952ef99dc74bcac110c426a82846d0d8a1c48657628c"}},{"ruleId":"D2","level":"warning","message":{"text":"Scenario.createHeadscaleEnvWithTags (cognitive 32): Scenario.createHeadscaleEnvWithTags has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":915}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9c48a55483b61f15ebfd0f62868e0d15ae3e26bcbed7c4771aa243efb87ef4b"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv2.registerKeys (cognitive 31): apiv2.registerKeys has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 4, boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 0 of the 31 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 167, 262, 217, \u2026). 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":"hscontrol/api/v2/keys.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba52f2791d1b92d81a8429b3cc1d57a68545cdf45373607b0947ff2fe4349de4"}},{"ruleId":"D2","level":"warning","message":{"text":"TailscaleInContainer.WaitForPeers (cognitive 30): TailscaleInContainer.WaitForPeers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, loops 4, match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/tsic/tsic.go"},"region":{"startLine":1320}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccab0660633fbbfb27a67960c234ed242d532fddbb027990dc55344760f31c88"}},{"ruleId":"D2","level":"warning","message":{"text":"ExtraRecordsMan.Run (cognitive 29): ExtraRecordsMan.Run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, match/switch 5, loops 1 (nesting depth added 19). Of this number, 25 points are the body\u0027s own statements and 4 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":"hscontrol/dns/extrarecords.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ecff3bf8d64670a97541fa4445707965ff4eeaa81c1b4bac89afdd78996262e"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.BuildPeerMap (cognitive 29): PolicyManager.BuildPeerMap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13, loops 10, boolean chains 6 (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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":606}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5b2f6f273d1d874d64fad4b5a7cd53bfcc49e27552025b02524f2677b12427d"}},{"ruleId":"D2","level":"warning","message":{"text":"HAHealthProber.ProbeOnce (cognitive 29): HAHealthProber.ProbeOnce has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 4, match/switch 2 (nesting depth added 14). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 143, 95). 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":"hscontrol/state/ha_health.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b60e3bffce87dfbf7ed2b1666c4ec8e9a7e4ae80a16f4fe82a789bb1bcf473e"}},{"ruleId":"D2","level":"warning","message":{"text":"types.validateServerConfig (cognitive 29): types.validateServerConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/types/config.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"88888b0b9e4ba6cf132f04539015208342644259050437db3ed7e248b5d081ea"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.validateUserReferences (cognitive 28): v2.validateUserReferences has cognitive complexity 28 (threshold 15). Drivers by points: loops 20, if/else 6, boolean chains 2 (nesting depth added 7). Of this number, 22 points are the body\u0027s own statements and 6 belong to 4 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddee4ff1c75beb5a6f958ffd5c774456936325243a4d2aa0c51952321a6a8941"}},{"ruleId":"D2","level":"warning","message":{"text":"Groups.UnmarshalJSON (cognitive 28): Groups.UnmarshalJSON has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, loops 12, match/switch 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1314}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b6019f5504b009e6698272cd41446f1a4ff7f3933cae47b6ff3a24c432fd464"}},{"ruleId":"D2","level":"warning","message":{"text":"State.createAndSaveNewNode (cognitive 28): State.createAndSaveNewNode has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 6 (nesting depth added 4). Of this number, 23 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/state/state.go"},"region":{"startLine":1890}}}],"partialFingerprints":{"codehealthFindingId/v1":"493af9df0f1f0f4241044a1dcc46e9165a2dc4c09e50a16ea2a1365f8239ec20"}},{"ruleId":"D2","level":"warning","message":{"text":"State.HandleNodeFromAuthPath (cognitive 28): State.HandleNodeFromAuthPath has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/state/state.go"},"region":{"startLine":2205}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3eace348d595b7355a62d049a74243139be6ee71a9aa43752c2f913341e11e2"}},{"ruleId":"D2","level":"warning","message":{"text":"mapSession.serveLongPoll (cognitive 27): mapSession.serveLongPoll has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 3, match/switch 2 (nesting depth added 12). Of this number, 18 points are the body\u0027s own statements and 9 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":"hscontrol/poll.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"837275fec74b1fdc50c637702e1f510f981a67fdb9e12ac1d9881c9510f39774"}},{"ruleId":"D2","level":"warning","message":{"text":"Scenario.CreateTailscaleNodesInUser (cognitive 27): Scenario.CreateTailscaleNodesInUser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 2, boolean chains 1 (nesting depth added 15). Of this number, 21 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":643}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8ab2f3762496124696e51321662294044f482ca013433cd70000c482c4028e1"}},{"ruleId":"D2","level":"warning","message":{"text":"db.runMigrations (cognitive 26): db.runMigrations has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 5 (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":"hscontrol/db/db.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6900506e091d22ec67de939fa826143df5c6340c921ae0fdf0f00e1a943d219"}},{"ruleId":"D2","level":"warning","message":{"text":"HSDatabase.BackfillNodeIPs (cognitive 26): HSDatabase.BackfillNodeIPs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 1 (nesting depth added 11). Most of this is not in the body itself: 0 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 312). 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":"hscontrol/db/ip.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"3261e5b50b7a23d6b123dee433cdc5ee4f3d149f0619183df44f33801c8f8cc5"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.compileAutogroupSelf (cognitive 26): v2.compileAutogroupSelf has cognitive complexity 26 (threshold 15). Drivers by points: loops 15, if/else 9, boolean chains 2 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":700}}}],"partialFingerprints":{"codehealthFindingId/v1":"9755f80fa21cc20fa4474192dc6e4afbd0a7337ae4871e0fbfd818defc3ef96b"}},{"ruleId":"D2","level":"warning","message":{"text":"Scenario.ShutdownAssertNoPanics (cognitive 26): Scenario.ShutdownAssertNoPanics has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 8 (nesting depth added 11). Of this number, 24 points are the body\u0027s own statements and 2 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":"integration/scenario.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"0286fa4b8551defe4ace45f2273bd1b795dc168a14feb8718cd8c8d217187234"}},{"ruleId":"D2","level":"warning","message":{"text":"StatsCollector.collectStatsForContainer (cognitive 25): StatsCollector.collectStatsForContainer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/stats.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"5868012c6ca91bb58b6676c403c1eea70b20bd7df314714b3e892d81751cb697"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv2.registerDevices (cognitive 25): apiv2.registerDevices has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, loops 3 (nesting depth added 3). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 251, 297, 330, \u2026). 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":"hscontrol/api/v2/devices.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"c23effb7fde1cde6f183113b1eed68636ea150902fba92db17f1af648783a4ee"}},{"ruleId":"D2","level":"warning","message":{"text":"AuthProviderOIDC.OIDCCallbackHandler (cognitive 25): AuthProviderOIDC.OIDCCallbackHandler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/oidc.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f0330b07e00d564289aacb307c525e551395c3f8a622a970129eceb6eadd96d"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.validateSSHSrcDstCombination (cognitive 25): v2.validateSSHSrcDstCombination has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, match/switch 4, boolean chains 3, loops 2 (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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2146}}}],"partialFingerprints":{"codehealthFindingId/v1":"13271c991e8f2e2ebbebb8ec4aeddbea39ea5ed57ac7e2bbf00e7bb59dff9df6"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.nodesToPtables (cognitive 24): cli.nodesToPtables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 2 (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":"cmd/headscale/cli/nodes.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"6706d77afa3bbbaf874dd1bb5ecc63fd19d028986eeff85baab5671e0efa6c8d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.listControlFiles (cognitive 24): main.listControlFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, loops 7, boolean chains 3, match/switch 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/docker.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"9236d401424fe9fee2d85576781b44edd52c1283743e8e968637094e7f20894e"}},{"ruleId":"D2","level":"warning","message":{"text":"main.getCurrentTestContainers (cognitive 24): main.getCurrentTestContainers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 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":"cmd/hi/docker.go"},"region":{"startLine":709}}}],"partialFingerprints":{"codehealthFindingId/v1":"37647e6a5169cea6e797aede3e82f0d37ba4245e5e7df4c3b29d53120041aa80"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.compileNodeAttrs (cognitive 24): Policy.compileNodeAttrs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, loops 9, boolean chains 1 (nesting depth added 9). Of this number, 22 points are the body\u0027s own statements and 2 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":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"f73d0eb76d4deeb150464f92a5cd51c0a78ee4a55329574914812f9d06b6c134"}},{"ruleId":"D2","level":"warning","message":{"text":"State.RoutesForPeer (cognitive 24): State.RoutesForPeer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 6, 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":"hscontrol/state/state.go"},"region":{"startLine":1244}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f3c14ccae253e36d058a0756437d389975f1e33f733e8b0d04383b00f4c2f54"}},{"ruleId":"D2","level":"warning","message":{"text":"policyutil.ReduceFilterRules (cognitive 23): policyutil.ReduceFilterRules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 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":"hscontrol/policy/policyutil/reduce.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"c65d7b637b0dfd3fad190cc603c901d63aa48effc0f38feb0e0883de57377665"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.parsePortRange (cognitive 23): v2.parsePortRange has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, loops 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":"hscontrol/policy/v2/utils.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b57598ec949e5354c389189f5b378f954207158a8a26f804590565b8528db0c"}},{"ruleId":"D2","level":"warning","message":{"text":"HeadscaleInContainer.SaveDatabase (cognitive 23): HeadscaleInContainer.SaveDatabase has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/hsic/hsic.go"},"region":{"startLine":884}}}],"partialFingerprints":{"codehealthFindingId/v1":"93236a9890383ca0611ec2bd87818b72e642cb058af0898d9dd948b60a29d365"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv2.createAuthKey (cognitive 22): apiv2.createAuthKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/api/v2/keys.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"62e821ea90508d315d779a3633b2c67e8f7a1a3259daf00879e11de74ffd3f43"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.groupSourcesByUser (cognitive 22): v2.groupSourcesByUser has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, loops 9, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/filter.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bc904500e4a645d5c97b8c6294bff5b9c9ec504cd4da955c25d56f5c3520c71"}},{"ruleId":"D2","level":"warning","message":{"text":"tsric.New (cognitive 22): tsric.New has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/tsric/tsric.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3031387c6c9307b7ea7787f0216d3b54161c1813c2c0d2c5f266d9c893a317e"}},{"ruleId":"D2","level":"warning","message":{"text":"db.openDB (cognitive 21): db.openDB has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"hscontrol/db/db.go"},"region":{"startLine":1054}}}],"partialFingerprints":{"codehealthFindingId/v1":"32dd3d61b09afd8e586217511a36ae17e13f4b7f1991fd43dc84cfa4dc805f65"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.resolveAutoApprovers (cognitive 21): v2.resolveAutoApprovers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1523}}}],"partialFingerprints":{"codehealthFindingId/v1":"baf2b101cc6eb981f0d8af226be8d3158366eebcaf0acdca6c49fea7d16ca930"}},{"ruleId":"D2","level":"warning","message":{"text":"SSHPolicyTestResults.Errors (cognitive 21): SSHPolicyTestResults.Errors has cognitive complexity 21 (threshold 15). Drivers by points: loops 18, if/else 3 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/sshtest.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d617c497af1346a6b5fdd2cadf153b15da05e3bd1faf1cdaf3e472919c119b1"}},{"ruleId":"D2","level":"warning","message":{"text":"integration.doLoginURLWithClient (cognitive 21): integration.doLoginURLWithClient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":1154}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9963759bc9bb8aa1c3f51f5dc834b3de6b854ace72bc2fed4e46b93d31ce39e"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv1.registerNodeWriteOps (cognitive 20): apiv1.registerNodeWriteOps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 283, 370, 255, \u2026). 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":"hscontrol/api/v1/nodes.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"528aee443493809dc645384bc2c7fd033d0e319fce683db30e99d7200ff07585"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv2.createOAuthClient (cognitive 20): apiv2.createOAuthClient has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/api/v2/keys.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"2837982865d49a2f4b148afbbe9acd743e2cf1ac265a2ace764be40a42a43ee5"}},{"ruleId":"D2","level":"warning","message":{"text":"mapper.ReadMapResponsesFromDirectory (cognitive 20): mapper.ReadMapResponsesFromDirectory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/mapper/mapper.go"},"region":{"startLine":576}}}],"partialFingerprints":{"codehealthFindingId/v1":"532a50a56a8912ba78606331df46a8b6def494cd92f46a4921dba18b6e8c6aeb"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.resolveTagOwners (cognitive 20): v2.resolveTagOwners has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, loops 8, match/switch 3 (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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1716}}}],"partialFingerprints":{"codehealthFindingId/v1":"10b9d71d284fe7fd6d17d911d2223563e36ce9a803ef4e246bd28ebc0184ebdb"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.compileOtherDests (cognitive 20): Policy.compileOtherDests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":487}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a3210752f8d18a60c4cb9dcaf397476e1b32637f7090cbba2a7af90827757e7"}},{"ruleId":"D2","level":"warning","message":{"text":"util.ParseIPSet (cognitive 20): util.ParseIPSet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, boolean chains 1 (nesting depth added 7). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/util/addr.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"e79786bf47499c05b8f6a4066f336e82b7e3f3eff9bfd3c5459fe46acb7effd7"}},{"ruleId":"D2","level":"warning","message":{"text":"cli.initConfig (cognitive 19): cli.initConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"cmd/headscale/cli/root.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"689376080570b199498b8488663036a2864e3e8f9bcaaefb6221565ea827ff6f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cleanOldImages (cognitive 19): main.cleanOldImages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 2 (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":"cmd/hi/cleanup.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b2b0130923d9e630cb261c403a5e0a22873ee3a2e9d8b64852bc7b650725219"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv1.registerNodeAdminOps (cognitive 19): apiv1.registerNodeAdminOps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 418, 468, 510, \u2026). 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":"hscontrol/api/v1/nodes.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1a7cc54f6181bf7c299ce1664d92840751be22672de8bcf14e65d0fea44e02b"}},{"ruleId":"D2","level":"warning","message":{"text":"IPAllocator.next (cognitive 19): IPAllocator.next has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/db/ip.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6362cde5de6a1e65de85ec4ff1595724071f1dec2a0b53d895a966cbfe30670"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.compileViaForNode (cognitive 19): v2.compileViaForNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 8, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fbf5b91119b401cda5b575d978d89254b077c39ddacc89303a14170e1d1a772"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.aclToGrants (cognitive 19): v2.aclToGrants has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 7, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1900}}}],"partialFingerprints":{"codehealthFindingId/v1":"635c7a060b011103bfc2774ad6b48d6654140fcc7e94b63904dec06a2c95f3a7"}},{"ruleId":"D2","level":"warning","message":{"text":"Policy.destinationsToNetPortRange (cognitive 19): Policy.destinationsToNetPortRange has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 9 (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":"hscontrol/policy/v2/filter.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"d588c9fe128cc54aec02a398504942e00ce5c33e5cf4789972f8e8d4b84651ff"}},{"ruleId":"D2","level":"warning","message":{"text":"types.LoadServerConfig (cognitive 19): types.LoadServerConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, match/switch 1 (nesting depth added 2). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. 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":"hscontrol/types/config.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"e879a11c7d20e1cdce60b9581b8c634e5300de93b50895017df9f84d3f77203b"}},{"ruleId":"D2","level":"warning","message":{"text":"Scenario.RunTailscaleUpWithURL (cognitive 19): Scenario.RunTailscaleUpWithURL has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (nesting depth added 11). Of this number, 10 points are the body\u0027s own statements and 9 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":"integration/scenario.go"},"region":{"startLine":988}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cb322b627d1b3e845d7a255c9cc9b07aa8a44ccf7fe1e88d3c3c8c77986fee1"}},{"ruleId":"D2","level":"warning","message":{"text":"StatsCollector.monitorDockerEvents (cognitive 18): StatsCollector.monitorDockerEvents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 2, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/stats.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"300e90bdeed2110c389628624074a34a13734405c71ca329aeb4c060a4f0155d"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv1.registerPolicy (cognitive 18): apiv1.registerPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 111, 63, 169). 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":"hscontrol/api/v1/policy.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a2cd500ae131ce7624dfbd7403c89c82339103fadeb8c8ad4f15ab73c6fb29b"}},{"ruleId":"D2","level":"warning","message":{"text":"Batcher.addToBatch (cognitive 18): Batcher.addToBatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 7). Of this number, 12 points are the body\u0027s own statements and 6 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":"hscontrol/mapper/batcher.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e0868262b31985ca99a7f60e34f060bf842367cd30e3df33426aa387378e29f"}},{"ruleId":"D2","level":"warning","message":{"text":"v2.validateTests (cognitive 18): v2.validateTests has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 5, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":3197}}}],"partialFingerprints":{"codehealthFindingId/v1":"d90fe4fd76a9dde4c8cf7cd9189955d9c9237b29765bd927686d94f6724e6c62"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.userMatchesOwner (cognitive 18): PolicyManager.userMatchesOwner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2, 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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1068}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c05d3cc1bcaac32d920cd92d17e5ade208c297ae0bec47ff14667daadaadcd"}},{"ruleId":"D2","level":"warning","message":{"text":"state.electPrimaryRoutes (cognitive 18): state.electPrimaryRoutes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/state/node_store.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"84e1aed7d2d1e0e8a0f770db143ca5a851a60ca77fb5a1173140bcf95664f688"}},{"ruleId":"D2","level":"warning","message":{"text":"State.DebugOverviewJSON (cognitive 18): State.DebugOverviewJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 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":"hscontrol/state/debug.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a17f042520e76352180d589a472903bac94bf65e97b0107b78741495c30c58c"}},{"ruleId":"D2","level":"warning","message":{"text":"State.findExistingNodeForPAK (cognitive 18): State.findExistingNodeForPAK has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2, match/switch 2 (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":"hscontrol/state/state.go"},"region":{"startLine":2398}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1a7a475f3ca699471d6b9f310331ab39e68d2854835d0ab5c16910514ad1924"}},{"ruleId":"D2","level":"warning","message":{"text":"dsic.New (cognitive 18): dsic.New has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/dsic/dsic.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c7ec363735299335d94d3f09ec09a983232ec26108f9b02df23b8584732fb8e"}},{"ruleId":"D2","level":"warning","message":{"text":"main.createDockerClient (cognitive 17): main.createDockerClient has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/hi/docker.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0ba974104223ff7a7788daf969970d8b81dbc4a92bca8d875d2aa0b3a94b6d7"}},{"ruleId":"D2","level":"warning","message":{"text":"db.RegisterNodeForTest (cognitive 17): db.RegisterNodeForTest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/db/node.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0c8886f304f18be6f3d349298200e3655c8c22c99bbbda5685b707e137e61ba"}},{"ruleId":"D2","level":"warning","message":{"text":"servertest.AssertConsistentState (cognitive 17): servertest.AssertConsistentState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 5, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/servertest/assertions.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"01456c5c24c043bb9b9e8ed35b9f3ce97d6f3ab5358620de906d81db5c377312"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.CanAccessRoute (cognitive 17): Node.CanAccessRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, 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":"hscontrol/types/node.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"21cf69750227025baa93798fede540716e2cfaa97c0eba5ee7a8c955407b785b"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv1.registerUsers (cognitive 16): apiv1.registerUsers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 2). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 172, 73, 108, \u2026). 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":"hscontrol/api/v1/users.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"328d0bb9e917320e0f117842207eed10694e1d36bd3971eabc17a8cac3d6ec92"}},{"ruleId":"D2","level":"warning","message":{"text":"apiv2.registerACL (cognitive 16): apiv2.registerACL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 3). 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 93, 64). 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":"hscontrol/api/v2/acl.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecaf834dc9efccb7520345d2d2c67c919c16c55d807f94384283495de979a67c"}},{"ruleId":"D2","level":"warning","message":{"text":"Headscale.waitForFollowup (cognitive 16): Headscale.waitForFollowup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 5 (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":"hscontrol/auth.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"143c9f5beffbe92f62afeb24638ee51589aa609ec73a3cbb08e7344e94533f08"}},{"ruleId":"D2","level":"warning","message":{"text":"mapper.generateMapResponse (cognitive 16): mapper.generateMapResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2 (nesting depth added 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":"hscontrol/mapper/batcher.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dedb7fa3225b9592c1a1d18c76e4fcd39d632c2755ad7992e84c34b84501f8f"}},{"ruleId":"D2","level":"warning","message":{"text":"mapper.buildFromChange (cognitive 16): mapper.buildFromChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/mapper/mapper.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3477ee10bfc9603d9d927d081e256db762069bb946e5c3ea33eae20df3cdc7f"}},{"ruleId":"D2","level":"warning","message":{"text":"PolicyManager.updateLocked (cognitive 16): PolicyManager.updateLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aab37eebfbcbc6921c4c837775378a836f04182afcbb6b2a709eb4b3168daf5"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: State: TooManyMethods \u2014 130 methods, declared across 4 files: state/state.go (109), state/debug.go (16), state/ping.go (3), state/node_health.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/state/state.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f618a76ec5d4934a0b72c6eae795ffc7e932cfb572224c5c7869bf62e78902"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: v2/types.go: FileTooLong \u2014 1766 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":"hscontrol/policy/v2/types.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae5e29cc81004dc71ccac538bc2af3f84814e4913f38a446ad0a0574c6af1cc0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: state/state.go: FileTooLong \u2014 1516 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":"hscontrol/state/state.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"17dc8c6c9f27d60b661248b54748000eb1389d0586a6d9a5113e6f3ff7957738"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: hsic/hsic.go: FileTooLong \u2014 985 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":"integration/hsic/hsic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e4959746a62e5d4b3965d7a4c0c5eb8bc4da45c56ba802b109e9efa865a3f08"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: HSDatabase: TooManyMethods \u2014 58 methods, declared across 8 files: db/node.go (16), db/api_key.go (9), db/preauth_keys.go (9), db/users.go (9), \u002B4 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/db/db.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1bbf7f9fde7032939543e534b32fcaf29221a5c94adc469173eafd9ec7b295c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: integration/scenario.go: FileTooLong \u2014 933 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":"integration/scenario.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e70febc910a6ce2616881d880a535d201ae4aae76af6e253fc109ad68cb0c15b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tsic/tsic.go: FileTooLong \u2014 905 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":"integration/tsic/tsic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3609db80fa543dcc01337c5781580af2936284e0151ee2d2219b95f205a1ec8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: HeadscaleInContainer: TooManyMethods \u2014 53 methods. Most of these members implement integration.ControlServer (36 of 53 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/hsic/hsic.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a76cf22422527509499ebc9634afa126c0571180ab73f7b291b495cd623da41"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: v2/policy.go: FileTooLong \u2014 848 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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4e4eaef612fc07d82464718593bfeb71ff14ea71cb21b872df2cd5055daa9ab"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/config.go: FileTooLong \u2014 844 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":"hscontrol/types/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae2110eb92e3d38b92d231d1470ad3039bc86210543655730c10417238b91b55"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TailscaleInContainer: TooManyMethods \u2014 46 methods. Most of these members implement integration.TailscaleClient (39 of 46 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/tsic/tsic.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"efb44c2cee9f106afb7c1e5b2034a3cbd53ce5d33631318983a5afa0b8f4b23a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Scenario: TooManyMethods \u2014 42 methods, declared across 2 files: integration/scenario.go (40), integration/helpers.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/scenario.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"a301dce0f049e893d9514749461be557229ffe76abe0f2cdffede14d56492a2c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: hscontrol/app.go: FileTooLong \u2014 652 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":"hscontrol/app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"917f2604fd45d8b2b65f980a757daac7870906e408d3f517dd62c5b5d7a3f657"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: db/db.go: FileTooLong \u2014 625 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: NewHeadscaleDatabase (55-1052). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/db/db.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7905e9800905fdedc31f22c4383319ea8b72ce2dc608d0e45cd211e742f2988"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Headscale: TooManyMethods \u2014 37 methods, declared across 7 files: hscontrol/app.go (14), hscontrol/auth.go (6), hscontrol/handlers.go (6), hscontrol/debug.go (5), \u002B3 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/app.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"50e7e2dc615c712be02d9c499cf9d34112a394fcea32828b94950c6d26d265e3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: integration/helpers.go: FileTooLong \u2014 593 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":"integration/helpers.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ee60f2f4c4085d5be3e38c85f30395ca3af73ad001d924cad908b39ff27ed0b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/node.go: FileTooLong \u2014 568 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":"hscontrol/types/node.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"79adb59bdb70ae9ca039d78659c103d56ff57fd955b7fc651dcd01557e25aa92"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: PolicyManager: TooManyMethods \u2014 32 methods, declared across 3 files: v2/policy.go (30), v2/sshtest.go (1), v2/test.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/policy.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"aef2185a4a4a7a70204576d7aa48e60550bc1a692f362859634867e954e09db0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: hscontrol/oidc.go: FileTooLong \u2014 529 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":"hscontrol/oidc.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"386b3a0c5a7f22c5c16346adec02b3e30a5b5db3ead439f3433eac843017fd0e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: state/node_store.go: FileTooLong \u2014 503 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":"hscontrol/state/node_store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"50528c75cab26f2489b70c6f68eeef3ff1e18633b2ead132421d096e7eb176ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): hscontrol/policy/v2/types.go:2345-2362 | hscontrol/policy/v2/types.go:2584-2601 \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 \u0060hscontrol/policy/v2/types.go:2345\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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2345}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e46aa1d715a4820c732ef18de685a450f61753cccd345de19f6a52fe6f0212e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): integration/integrationutil/util.go:162-177 | integration/integrationutil/util.go:203-218 \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":"integration/integrationutil/util.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cabebd420172876a8fc3ef72be1f5c418c6bd487ae2b9ea0e4d7c59c34bc2aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 4): hscontrol/policy/v2/types.go:2463-2477 | hscontrol/policy/v2/types.go:2734-2748 | hscontrol/policy/v2/types.go:2761-2775 | hscontrol/policy/v2/types.go:2781-2795 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060hscontrol/policy/v2/types.go:2463\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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2463}}}],"partialFingerprints":{"codehealthFindingId/v1":"0296b89c97ae4e2153805f597c607d76a7a77fb1deb6ad34b3a86f6884097d18"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): hscontrol/api/v1/auth.go:90-104 | hscontrol/api/v1/nodes.go:482-497 \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 \u0060hscontrol/api/v1/auth.go:90\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":"hscontrol/api/v1/auth.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"0082ca1b70ae43df7f1360266fd5c5555e0adb6ef1a2646d030cd1ef41595398"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): hscontrol/policy/v2/types.go:1119-1133 | hscontrol/policy/v2/types.go:2979-2993 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1119}}}],"partialFingerprints":{"codehealthFindingId/v1":"63d4f8c748d1872f6d0e00622942ef7e4e6a00b59bed7171eea4a26d3875ca20"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): hscontrol/policy/v2/types.go:2385-2399 | hscontrol/policy/v2/types.go:2625-2639 \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 \u0060hscontrol/policy/v2/types.go:2385\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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2385}}}],"partialFingerprints":{"codehealthFindingId/v1":"a16ed9888b244e97682fde055a343d38e2c0fee7605e09cd0e0b77de355039b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): hscontrol/api/v1/preauthkeys.go:222-235 | hscontrol/api/v1/preauthkeys.go:250-263 \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 \u0060hscontrol/api/v1/preauthkeys.go:222\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/api/v1/preauthkeys.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"2794a0169dbd91fc081f07db49c671780f7a7c689456455ad57b7da2aab82279"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): integration/dsic/dsic.go:255-268 | integration/tsic/tsic.go:591-604 \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 \u0060integration/dsic/dsic.go:255\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/dsic/dsic.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"a362c5a3fa718bb7b71e7a2300021add531b10da5af03dae4201ee2caf2ab028"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): integration/hsic/hsic.go:552-565 | integration/tsic/tsic.go:499-512 \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 \u0060integration/hsic/hsic.go:552\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/hsic/hsic.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fea1eba2c25c9be5409b7900902d1ef261e9bf78252f383ae3645af40fa4d69"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): integration/tsic/tsic.go:551-564 | integration/tsic/tsic.go:571-584 \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 \u0060integration/tsic/tsic.go:551\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/tsic/tsic.go"},"region":{"startLine":551}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e32428209b2f1eed34f288690d23eb6daf89d082f3486a9edb4eab4fb50a31c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): hscontrol/db/api_key.go:223-234 | hscontrol/db/api_key.go:252-263 \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 \u0060hscontrol/db/api_key.go:223\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":"hscontrol/db/api_key.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"7afd393a0bc5562b7c78940ee28eb0ccf4410f9e495026fa7390facbf0294798"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): hscontrol/state/state.go:834-845 | hscontrol/state/state.go:869-880 \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 \u0060hscontrol/state/state.go:834\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":"hscontrol/state/state.go"},"region":{"startLine":834}}}],"partialFingerprints":{"codehealthFindingId/v1":"adfd1c6f00a4d3eb5d37283655940f8a904d540eb36efc0915f5b1b540871031"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): hscontrol/api/v1/policy.go:128-138 | hscontrol/api/v2/acl.go:121-131 \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 \u0060hscontrol/api/v1/policy.go:128\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"hscontrol/api/v1/policy.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"11257af1ac619110256c25ed9225653fd5767629aa349c389de4848abd2f89b6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): hscontrol/api/v1/policy.go:139-151 | hscontrol/api/v2/acl.go:132-142 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at \u0060hscontrol/api/v1/policy.go:139\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/api/v1/policy.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cc2bdafb2c64f171ca4081c7b5dfb8d4c725d2be57bf86372b9e5ecdaa78fa2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): hscontrol/policy/v2/compiled.go:278-291 | hscontrol/policy/v2/filter.go:269-279 \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 \u0060hscontrol/policy/v2/compiled.go:278\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/compiled.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"75c467edf105a1661daf28fddd7da305edbbcfea6583b3f2a352f05f6aed3dbf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): hscontrol/policy/v2/types.go:2903-2913 | hscontrol/policy/v2/types.go:2924-2934 \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 \u0060hscontrol/policy/v2/types.go:2903\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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2903}}}],"partialFingerprints":{"codehealthFindingId/v1":"a259d2760c59225e299f9e25980291477bcf5b31dbe4dc10cecf84b43134b4f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): integration/tsic/tsic.go:599-609 | integration/tsric/tsric.go:271-281 \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 \u0060integration/tsic/tsic.go:599\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":"integration/tsic/tsic.go"},"region":{"startLine":599}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f6c8df8cb7fa53e1358029db074cb529a8fc65c5474354554c296c50575ea82"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): hscontrol/app.go:642-655 | hscontrol/app.go:1012-1021 \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 \u0060hscontrol/app.go:642\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":"hscontrol/app.go"},"region":{"startLine":642}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ebf098ab306ddb5d3e8c42eca6403e1c5a7ec6b6dae80f2dbd5f0738c06db79"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): hscontrol/policy/v2/types.go:1196-1205 | hscontrol/policy/v2/types.go:1281-1290 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/policy/v2/types.go"},"region":{"startLine":1196}}}],"partialFingerprints":{"codehealthFindingId/v1":"da2b65bbb3792107f2b5984dbd38b842efdf44c3bef44184d4eccee7bc0fc65f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): hscontrol/api/v1/nodes.go:429-439 | hscontrol/api/v2/devices.go:393-401 \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 \u0060hscontrol/api/v1/nodes.go:429\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":"hscontrol/api/v1/nodes.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bb9e671dce2de933fd2fdc6ae2cd884c3fac3b28e6e1d46a2bcba75daff7ee2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): hscontrol/policy/v2/types.go:2617-2625 | hscontrol/policy/v2/types.go:2673-2681 \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 \u0060hscontrol/policy/v2/types.go:2617\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":"hscontrol/policy/v2/types.go"},"region":{"startLine":2617}}}],"partialFingerprints":{"codehealthFindingId/v1":"37a26560743f939f542def20386b2bd8ba138f9a92adadaf261a748edfd21950"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): hscontrol/state/state.go:2344-2351 | hscontrol/state/state.go:2826-2833 \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 \u0060hscontrol/state/state.go:2344\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":"hscontrol/state/state.go"},"region":{"startLine":2344}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ebf4440eff45b8cdcb5008a50a3554d138ef29f08de5268b71122c873f0178"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): integration/scenario.go:371-381 | integration/scenario.go:398-405 \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 \u0060integration/scenario.go:371\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":"integration/scenario.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf593872e859f978768fc25bdc25fccc77575284cf93465b584d0b641130c903"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): hscontrol/policy/v2/types.go:274-280 | hscontrol/policy/v2/types.go:992-998 \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 \u0060hscontrol/policy/v2/types.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":"hscontrol/policy/v2/types.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"a119befd9f61595a9cadb69e46cc0103135e86f1ba511c88f94c5f84dab7c574"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): hscontrol/state/state.go:1833-1838 | hscontrol/state/state.go:1993-1998 \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 \u0060hscontrol/state/state.go:1833\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":"hscontrol/state/state.go"},"region":{"startLine":1833}}}],"partialFingerprints":{"codehealthFindingId/v1":"593634c2241a24476330e66f0004c4c57664419ddb6b0070cce3675e2deca6b6"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/state/state.go: hscontrol/state/state.go changed 38 times in last 90 days, max complexity 60. 1 of those changes was a fix/bug commit, and the other 37 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"hscontrol/state/state.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"53b8ba3bacebd2270c0617e9f950931950b7238006d6d2741b0730b748e20157"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/policy/v2/types.go: hscontrol/policy/v2/types.go changed 14 times in last 90 days, max complexity 124. 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":"hscontrol/policy/v2/types.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa46f758ff328b6372acc4ab9f5501ef749d4d8befecd3c460ae57f2bb5a9a89"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/db/db.go: hscontrol/db/db.go changed 8 times in last 90 days, max complexity 100. 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":"hscontrol/db/db.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"833670b00efbbf6eec4717e1b0573eb1a735825ec2838a98c0da81dd1a5eb5a1"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/policy/v2/policy.go: hscontrol/policy/v2/policy.go changed 17 times in last 90 days, max complexity 46. 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":"hscontrol/policy/v2/policy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f7e9854392115a5c53fabde94980f24d9b76481af61272c0b669f20f980e7b2"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/app.go: hscontrol/app.go changed 10 times in last 90 days, max complexity 37. 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":"hscontrol/app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"06dbde13e759989875a183fcbd81fce7b465d92aee6f207f8a3b1b472074071a"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/types/config.go: hscontrol/types/config.go changed 13 times in last 90 days, max complexity 26. 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":"hscontrol/types/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5067ffa9be89913d1b187940a39373cbd0d8ce7b9b9ff44e770b44e54036a159"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: integration/hsic/hsic.go: integration/hsic/hsic.go changed 8 times in last 90 days, max complexity 38. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"integration/hsic/hsic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b7af76946e1281507272420de668f42e9bc9b3d462ecb8564360c343a655e58"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: integration/tsic/tsic.go: integration/tsic/tsic.go changed 9 times in last 90 days, max complexity 33. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, 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":"integration/tsic/tsic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ad5a9b444937f75978dea58206ef1758f37e9e87a28ff6a7c52f1cc04763e51"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/oidc.go: hscontrol/oidc.go changed 10 times in last 90 days, max complexity 26. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, 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":"hscontrol/oidc.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa42e79995c28beb61e1afb769289edf3e78dda2861498e07c53bdc89acb5b49"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: hscontrol/state/node_store.go: hscontrol/state/node_store.go changed 8 times in last 90 days, max complexity 25. 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":"hscontrol/state/node_store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"03f49cbf7c953d250369bd34e2ad8da88d65909299ecce97437e1b00a932599f"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 85 significant file(s) lose their only recent owner: hscontrol/state/state.go, hscontrol/policy/v2/types.go, hscontrol/policy/v2/policy.go, integration/tsic/tsic.go, integration/hsic/hsic.go, integration/scenario.go, integration/helpers.go, hscontrol/types/node.go (\u002B77 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"2edae96e153033d4de9d6a22bfb2c6638bac94d16fd685a1d2115caccf91b10a"}},{"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":"6c9e4acbfa35b33f19eb6c333fc51bbb1e85fde84c169b56115c6879bc9a6964"},"taxa":[{"id":"CWE-78","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":"f892352ebe0c8c055a2590d6b772c4bf67378b6aff3809e4145b5d11f40aa16f"},"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":"c10015ba4ec311ed1369563fdf376082bdc886363b14379396bc8b753972d5fb"},"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":"a009956a7214d38e2d1cf69935fb6f13b5aac48cebefb483786a259f49dfe9ce"},"taxa":[{"id":"CWE-400","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":"da0880a7432813e2dd136c29607407b3bfa16ecfa5a5ed3d264ee657e210286b"},"taxa":[{"id":"CWE-400","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":"5967f0af9e91d4361145cb7f7246f050975dd3331c08054313369fc996e2f39a"},"taxa":[{"id":"CWE-400","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":"d7dec50653b99f38a7e7ddaafdb1857d361fa4ccbfd9ffe6efc1d51e65b313c1"},"taxa":[{"id":"CWE-327","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":"fada94ddd300a3422719ad2294f0124d233fd756ff7b3dc8c2c15fd0923ef749"},"taxa":[{"id":"CWE-327","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":"729a7ed9839b42bf10370cd05bed7b4fbdf8e94daca51972cafce389531b9ce4"},"taxa":[{"id":"CWE-1004","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":"d29866912cb32e714e72d57bae09762fe8144c1fb06c09b2735ac17562ec6df3"},"taxa":[{"id":"CWE-614","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":"0bb0992617184e5f86f1c7b9ad6ada2ec77ccfed9fdcf13994a2609c36687343"},"taxa":[{"id":"CWE-327","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":"e754ff50934978f3cd9074bd60f0d0eff29e8f32f42e3caea01456e01d00e35b"},"taxa":[{"id":"CWE-327","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":"f44089d0817acbc66d4976b01cf3bccf2c823bcb531c6d474251f16d22e1c349"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","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":"ad80ae41f1a718fd4b9232466e6c1c0d715a76adf4540f518ce6c59e8066c55b"}},{"ruleId":"D31","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":"873c1d5c7b5255bd4b824330ed4abd8fe4f8de39da47930321312967f720ee0e"}},{"ruleId":"D31","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":"50429c7c6de03c53a3a186fc8855914993180075007aa4508509c4d6851d8ec2"}},{"ruleId":"D31","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":"5a64f56c695d76361d11375c9be05a5796ab6f7471f764d4b1dd8d686411327f"}},{"ruleId":"D31","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":"4886f4f54ff8e8d22bd50052b7390a7e7a584353b4e56e2c9906d1e4c33504da"}},{"ruleId":"D31","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":"7a4d372cc8d965ccf62f80a6dc3053e571a8e1aed909327efb087991fe31905c"}},{"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":"5113b0689709ff82002efa637928f7055552f11096629702331f20e8fcce3c80"}},{"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":"686a2f3701136c72e6f3f22017ef3b56f13627803d368fba97e52af832ebf5d7"}},{"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":"934601e96d8e912590c878d24cf1c1f36c9271cd0a6aa7528389dde4a0636ecc"}},{"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":"51e72cfe71278b8ded660888f41f5c30047943f0e62f05a558cc9e6398347f93"}},{"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":"1f50fff53015c6e43f78d4c8267006c58e042c8d9a1132f7d0639f4de41868d5"}},{"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":"d06aab437224216f8fbd9a50e244e94277fe47698168cd1f9cdfbf7c8fa7588c"}},{"ruleId":"D31","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5c551f039443ebb498002dce23ede7fa517f38f4222afc6c9dcf55058ac9285d"}},{"ruleId":"D31","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ce25bdf0342f3f3a6efacc785ad7759ada211aa204700c37a90841b0f095e922"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0e17f71490e4d120a48b2b2881ab866c93b272bef2febb673a3e8e42b2c288ab"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0752d0df7434000fcabf1048e2de30a7a1a8b982b3db9a19898c4dec199856b4"}},{"ruleId":"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":"a1c588a767644909cb909e3780c7ec5981286503cab740ff80dc7697b1221593"}},{"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":"50c379534161bb30611d421e82af3666b891a67b9a6a35df5a4fc4b4977e653b"}},{"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":"5cdf8e768e620a1c00298b557799acdadfbaa1dd146ce9c178cc8051c1fe828c"}},{"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"}}],"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-1004","guid":"872195c9-bb07-cf51-8a32-865f4bb753ca","name":"CWE-1004","shortDescription":{"text":"CWE-1004"},"helpUri":"https://cwe.mitre.org/data/definitions/1004.html"},{"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-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-327","guid":"e51910ff-67b5-3c51-aa3d-92837d9eab90","name":"CWE-327","shortDescription":{"text":"CWE-327"},"helpUri":"https://cwe.mitre.org/data/definitions/327.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-400","guid":"ca529a89-676d-8857-aac1-84359c77bb6c","name":"CWE-400","shortDescription":{"text":"CWE-400"},"helpUri":"https://cwe.mitre.org/data/definitions/400.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-614","guid":"faa8a6a5-7e9d-5d5e-afc9-020ff49d250a","name":"CWE-614","shortDescription":{"text":"CWE-614"},"helpUri":"https://cwe.mitre.org/data/definitions/614.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":39,"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."]}]}