{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D31","name":"IaC \u0026 Container Security","shortDescription":{"text":"IaC \u0026 Container Security"},"helpUri":"https://codehealth.canine.dev/dimensions/D31","relationships":[{"target":{"id":"CWE-1032","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-16","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}},{"id":"D40","name":"Network Egress Confinement","shortDescription":{"text":"Network Egress Confinement"},"helpUri":"https://codehealth.canine.dev/dimensions/D40"},{"id":"D41","name":"Kernel \u0026 Syscall Confinement","shortDescription":{"text":"Kernel \u0026 Syscall Confinement"},"helpUri":"https://codehealth.canine.dev/dimensions/D41"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"command.parseWatchArgs (cyclomatic 46): command.parseWatchArgs 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":"etcdctl/ctlv3/command/watch_command.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2a3845efb40993cbd0afdec1e5baebbe66ea893238189eed371c2455cd30075"}},{"ruleId":"D1","level":"warning","message":{"text":"watchGRPCStream.run (cyclomatic 44): watchGRPCStream.run has cyclomatic complexity 44 (threshold 15). Of this number, 38 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":"client/v3/watch.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"d59c2fc6ee285fd2ba816cf68828fa428cb74f8cc82b8285b3ddcafc73e6d856"}},{"ruleId":"D1","level":"warning","message":{"text":"server.ioCopy (cyclomatic 41): server.ioCopy has cyclomatic complexity 41 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/proxy/server.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"f287a6e9dfd1852b99e2094ac0b27ac10c95ee27f818337872c1ae4a45ff9ab2"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.Validate (cyclomatic 39): Config.Validate has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/config.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0b0d1ca036631f51e57678f79f23304483903e8b257e8c78582571ae7a170a0"}},{"ruleId":"D1","level":"warning","message":{"text":"serverWatchStream.sendLoop (cyclomatic 36): serverWatchStream.sendLoop has cyclomatic complexity 36 (threshold 15). Of this number, 33 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":"server/etcdserver/api/v3rpc/watch.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e79ad0835c3858a148435d0cc410f8b05bb7c15fce0e8c9c6655df30ad3add6"}},{"ruleId":"D1","level":"warning","message":{"text":"TLSInfo.baseConfig (cyclomatic 35): TLSInfo.baseConfig has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 12 belong to 5 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":"client/pkg/transport/listener.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f1af357d5adc81827b36235690069cc6a4d733f058b1aa8a1380528fc9e7038"}},{"ruleId":"D1","level":"warning","message":{"text":"serverWatchStream.recvLoop (cyclomatic 34): serverWatchStream.recvLoop has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/watch.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce0441be9cd27c255291008cbc497d4c83bead338f870591d5cd2c2218682a4a"}},{"ruleId":"D1","level":"warning","message":{"text":"command.getGetOp (cyclomatic 32): command.getGetOp has cyclomatic complexity 32 (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":"etcdctl/ctlv3/command/get_command.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"732feb90809d06d201eda6da1279eda4cb806901e7821c3aaacad6c26424bddc"}},{"ruleId":"D1","level":"warning","message":{"text":"embed.configureClientListeners (cyclomatic 31): embed.configureClientListeners has cyclomatic complexity 31 (threshold 15). Of this number, 29 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":"server/embed/etcd.go"},"region":{"startLine":645}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0001e9ace7b6e5b696cba7f7636314a32af004b62d18c85d48842339dca57c0"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.setupLogging (cyclomatic 31): Config.setupLogging has cyclomatic complexity 31 (threshold 15). Of this number, 28 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":"server/embed/config_logging.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"55444a83c8f2d64a26de3648deb49d56addd72a954bb2d73e9c6922f2c4558a9"}},{"ruleId":"D1","level":"warning","message":{"text":"raftNode.start (cyclomatic 31): raftNode.start has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to one function literal inside it that branches (line 177). 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":"server/etcdserver/raft.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd65d73260ea770831e888597f691515d42f8a522b0fdf90a2b9e2795830835b"}},{"ruleId":"D1","level":"warning","message":{"text":"main.checkFileForExperimental (cyclomatic 29): main.checkFileForExperimental has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 9 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 255). 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":"tools/check-grpc-experimental/main.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"189cd932ae6caba16655f883dba875f227f269aca6ed2d9fea740db7f4700d96"}},{"ruleId":"D1","level":"warning","message":{"text":"configYAML.configFromFile (cyclomatic 29): configYAML.configFromFile has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/config.go"},"region":{"startLine":782}}}],"partialFingerprints":{"codehealthFindingId/v1":"d514a2f4d54b030de8301636faee018aa5d98b471f9084925d9d6a162f425597"}},{"ruleId":"D1","level":"warning","message":{"text":"serveCtx.serve (cyclomatic 28): serveCtx.serve has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 2 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":"server/embed/serve.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"17ad6ff20dcc381efbfe52e91e4259ff61cdf3ec491472676cf22eb6dd047d0b"}},{"ruleId":"D1","level":"warning","message":{"text":"cmd.rangeFunc (cyclomatic 27): cmd.rangeFunc has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 5 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":"tools/benchmark/cmd/range.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"90cd5fcdf6ad3cc25318a6a10a1f208c737f6e7f102ffdcbfe333a388e5db534"}},{"ruleId":"D1","level":"warning","message":{"text":"server.listenAndServe (cyclomatic 27): server.listenAndServe has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/proxy/server.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"8df15da2489615ac25c0215b229c70185e96576fbc4b7463a7c0b7fe8a42fa09"}},{"ruleId":"D1","level":"warning","message":{"text":"clientv3.newClient (cyclomatic 26): clientv3.newClient 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":"client/v3/client.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bd7c3d97bbfdff8029693abcc73bd08b9bb9a83c00d7230263e092cdd4cee8c"}},{"ruleId":"D1","level":"warning","message":{"text":"RaftCluster.ValidateConfigurationChange (cyclomatic 26): RaftCluster.ValidateConfigurationChange has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"91be385ad38752c3853684cdb5a9777ce67d775c3c4eb00711029542e2936cbf"}},{"ruleId":"D1","level":"warning","message":{"text":"WAL.ReadAll (cyclomatic 26): WAL.ReadAll has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"f600c69b11fa1fda6d1988db13efb3c5d887701ac3669e9d34fe1907789c5b84"}},{"ruleId":"D1","level":"warning","message":{"text":"main.printRec (cyclomatic 25): main.printRec 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":"tools/etcd-dump-logs/raw.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"be128385bf93925720f1e97aa2764238f52b6342f1fee5c7d31a10ff2d0fae3b"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 24): main.main has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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":"tools/local-tester/bridge/bridge.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"627883d5b1257bc3c27b1832ec917895b71ca95baf3e14902297fbfdac0c9ecf"}},{"ruleId":"D1","level":"warning","message":{"text":"command.makeMirror (cyclomatic 24): command.makeMirror has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"etcdctl/ctlv3/command/make_mirror_command.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fe78c47f23efbf5a6c706483f5240632155013745a24aefdae9005674142400"}},{"ruleId":"D1","level":"warning","message":{"text":"v3rpc.logUnaryRequestStats (cyclomatic 24): v3rpc.logUnaryRequestStats has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/interceptor.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d6a5a70af4f4b1a888640ba367fbda7b8a323c04b88b469ffd3bdd6cb442548"}},{"ruleId":"D1","level":"warning","message":{"text":"streamWriter.run (cyclomatic 23): streamWriter.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd81ffebe49e4a2920958eba2915eb4351fe474c270fb9929d63f9c5820aaa2c"}},{"ruleId":"D1","level":"warning","message":{"text":"etcdmain.startEtcdOrProxyV2 (cyclomatic 22): etcdmain.startEtcdOrProxyV2 has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdmain/etcd.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7d1279a64b28334f30d1d509327ce1858fdc45584832573fc56008a300a8c99"}},{"ruleId":"D1","level":"warning","message":{"text":"embed.StartEtcd (cyclomatic 21): embed.StartEtcd has cyclomatic complexity 21 (threshold 15). Of this number, 17 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":"server/embed/etcd.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ca47c633e41dc8f80fb53b01bc15335c9f4a1977c739975273ce4eba85492ea"}},{"ruleId":"D1","level":"warning","message":{"text":"v3rpc.checkIntervals (cyclomatic 21): v3rpc.checkIntervals 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":"server/etcdserver/api/v3rpc/key.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba57964b7ebec46ee84848dfe433ffb8d6af2aafd949e5e10617a521cb653ce1"}},{"ruleId":"D1","level":"warning","message":{"text":"main.parse (cyclomatic 20): main.parse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/etcd-dump-metrics/metrics.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a38bbcfc28bf34255167493ccaf117b7d3e62420d417f7df540a0bea02634f9"}},{"ruleId":"D1","level":"warning","message":{"text":"watchGRPCStream.serveSubstream (cyclomatic 20): watchGRPCStream.serveSubstream has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 3 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":"client/v3/watch.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"e53eede36db143737f8fe13c8d6d86c38e4a9a53c6b7af50712c917840c67946"}},{"ruleId":"D1","level":"warning","message":{"text":"leaseHandler.ServeHTTP (cyclomatic 20): leaseHandler.ServeHTTP has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/lease/leasehttp/http.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"f17027fe7510443ad2f812bd424ce7dd03fa0526aa9a03ad6e9a88f15c5da0bb"}},{"ruleId":"D1","level":"warning","message":{"text":"wal.Verify (cyclomatic 20): wal.Verify has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":704}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1fad8944611c7110c6fd60fa40e9297250b940566096e3ed1ed29eae66346a4"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 19): main.main has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 8 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":"tools/check-grpc-experimental/main.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"e459e825f38f63506a7662e2dc37d5b42c7ee6eca41209d5a765b2d42405dca3"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 19): main.main has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 5 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":"tools/etcd-dump-metrics/main.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"af0c65e7c222cd4335e18c49a9d3b133d469a8342e9493d021e86eaf2936eecb"}},{"ruleId":"D1","level":"warning","message":{"text":"msgAppV2Encoder.encode (cyclomatic 19): msgAppV2Encoder.encode 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":"server/etcdserver/api/rafthttp/msgappv2_codec.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab45aed114db00d221a093750c968c029b40f68461efad56d94307a506dd23c1"}},{"ruleId":"D1","level":"warning","message":{"text":"wal.Create (cyclomatic 19): wal.Create has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"db92e7a022660a7fb26703ab0b33c708882edf77ec0785a08fdd28b49f8cb281"}},{"ruleId":"D1","level":"warning","message":{"text":"Cache.Watch (cyclomatic 18): Cache.Watch has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 143). 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":"cache/cache.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1a3bbde4745f797857dd2b81542750b39ca451f13611f3b9a7efbbc952ce636"}},{"ruleId":"D1","level":"warning","message":{"text":"command.newCheckDatascaleCommand (cyclomatic 18): command.newCheckDatascaleCommand has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/check.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f20a540cde4e7752886e5d986312b63d6f9642732bd6cb6e1ef26e28a49ea4d"}},{"ruleId":"D1","level":"warning","message":{"text":"command.epHealthCommandFunc (cyclomatic 18): command.epHealthCommandFunc has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 118). 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":"etcdctl/ctlv3/command/ep_command.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5932968a25b90b3f906764efc92a14929ea0ea5c67a846040da8d95af40ad94"}},{"ruleId":"D1","level":"warning","message":{"text":"v3Manager.copyAndVerifyDB (cyclomatic 18): v3Manager.copyAndVerifyDB 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":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":436}}}],"partialFingerprints":{"codehealthFindingId/v1":"8522fd3cf2eb7029f33485533c5cb6f14ae106c8583c914dc34260842ecb2acf"}},{"ruleId":"D1","level":"warning","message":{"text":"EtcdServer.LeaseRenew (cyclomatic 18): EtcdServer.LeaseRenew has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/v3_server.go"},"region":{"startLine":488}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c471e3b195feaccd9df1e7ff69bcd4c23cd26a611840d89ca4c4b79ec96676"}},{"ruleId":"D1","level":"warning","message":{"text":"main.readUsingReadAll (cyclomatic 17): main.readUsingReadAll 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":"tools/etcd-dump-logs/main.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3a0404375157170905d6d0ac84dfbad885b3a0d1c6ebf5ae3bbb1d85da5fd85"}},{"ruleId":"D1","level":"warning","message":{"text":"Election.observe (cyclomatic 17): Election.observe 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":"client/v3/concurrency/election.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe897d1e4a01c6cd16e113fd1b1fd768fcbb7aab2a050d418cc6b150a33bc9ca"}},{"ruleId":"D1","level":"warning","message":{"text":"command.newCheckPerfCommand (cyclomatic 17): command.newCheckPerfCommand has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/check.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"860b820cf74ad17dd3f91f82b9fd4db52d573136d37c6de18838ea905bbaae34"}},{"ruleId":"D1","level":"warning","message":{"text":"v3Manager.Status (cyclomatic 17): v3Manager.Status has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 132). 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":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c3c3ff55e1e0f5e16ab7eb78dbccae945b23648189f894886f4ffafb70d5d80"}},{"ruleId":"D1","level":"warning","message":{"text":"EtcdServer.run (cyclomatic 17): EtcdServer.run has cyclomatic complexity 17 (threshold 15). Of this number, 9 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":"server/etcdserver/server.go"},"region":{"startLine":755}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd7352c91a83a9b2877465bed38f71a7b7ff7ed0273b01ad46d510f3e8ffb96c"}},{"ruleId":"D1","level":"warning","message":{"text":"watcher.send (cyclomatic 17): watcher.send has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/watcher.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"213dfcec3b032c6dc6ea21d36e41a1ef2538996c3aeb7cb3094c05bc037e406b"}},{"ruleId":"D1","level":"warning","message":{"text":"decoder.decodeRecord (cyclomatic 17): decoder.decodeRecord has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/decoder.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf24d67072f3a5fbc0c42667b5e01d9e2bfc79c4668a2112c7ca710c378fe98b"}},{"ruleId":"D1","level":"warning","message":{"text":"cmd.stmFunc (cyclomatic 16): cmd.stmFunc has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. 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":"tools/benchmark/cmd/stm.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"f04c20ce66bb7d057be6cb7634bf5ef49769b5214817449dff1ef3bdae7ea8f7"}},{"ruleId":"D1","level":"warning","message":{"text":"watcher.Watch (cyclomatic 16): watcher.Watch 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":"client/v3/watch.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"15a682b2624fc801479945e86393e740ca66712f967b52a03b9bb30a93f0680f"}},{"ruleId":"D1","level":"warning","message":{"text":"v3Manager.Restore (cyclomatic 16): v3Manager.Restore has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1b50b2ae41343a7b55c470a45f4b66b612c9722e3514b63541f58ca032f3dc9"}},{"ruleId":"D1","level":"warning","message":{"text":"accessController.ServeHTTP (cyclomatic 16): accessController.ServeHTTP has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/serve.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e40bb9f6e58a4e4b31baeead3b1c9e0b7e17933c0a3da2888cbb0ec1f445f3"}},{"ruleId":"D1","level":"warning","message":{"text":"etcdmain.startGateway (cyclomatic 16): etcdmain.startGateway has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdmain/gateway.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"206ed865e0008ec5b3fbd2d3b03346e45f0c20af9c84d61666087dc87db349f3"}},{"ruleId":"D1","level":"warning","message":{"text":"etcdmain.checkArgs (cyclomatic 16): etcdmain.checkArgs has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdmain/grpc_proxy.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bcc41a5d9c82d58b12faff50d7c23a5cbf4be46a6a5563643e0c70888eb97e3"}},{"ruleId":"D1","level":"warning","message":{"text":"streamReader.dial (cyclomatic 16): streamReader.dial has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":569}}}],"partialFingerprints":{"codehealthFindingId/v1":"48e3bf04b6fc7e3f5b1504bcb9b276ed0f78012f3a2f06b94a82626a785e08d4"}},{"ruleId":"D1","level":"warning","message":{"text":"apply.checkTxnReqsPermission (cyclomatic 16): apply.checkTxnReqsPermission has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/apply/auth.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"e26860e6a0f9e08f13604649eb6b0619426c510718051ce683c2ab899ee3c7b5"}},{"ruleId":"D1","level":"warning","message":{"text":"EtcdServer.applyConfChange (cyclomatic 16): EtcdServer.applyConfChange has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/server.go"},"region":{"startLine":1996}}}],"partialFingerprints":{"codehealthFindingId/v1":"da6262257a408ddd102b6b7ea9d394220c4b6b7790b48d3b514bddb714372c07"}},{"ruleId":"D1","level":"warning","message":{"text":"EtcdServer.rangeStream (cyclomatic 16): EtcdServer.rangeStream has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/v3_server.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"62775aeea9cacbe803233d718aef0e08215a763b2bfb57c024a383580c3a966a"}},{"ruleId":"D1","level":"warning","message":{"text":"leaseProxy.LeaseKeepAlive (cyclomatic 16): leaseProxy.LeaseKeepAlive has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 5 belong to 3 function literals inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/lease.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a5943583f3a21f01be38ab3b9ba40d166b4c64ef5aab11b3d49f148adab796c"}},{"ruleId":"D1","level":"warning","message":{"text":"WAL.cut (cyclomatic 16): WAL.cut has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":785}}}],"partialFingerprints":{"codehealthFindingId/v1":"07445d16865e82d3cd6c81ad631bfe96e08bb510e6e1ecf59cc592927a94e94e"}},{"ruleId":"D2","level":"warning","message":{"text":"watchGRPCStream.run (cognitive 99): watchGRPCStream.run has cognitive complexity 99 (threshold 15). Drivers by points: if/else 83, match/switch 8, boolean chains 4, loops 4 (nesting depth added 64). Of this number, 91 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/watch.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"073b584381865fa8ed2679e45d82297115971b773402c0dd9601fb4f81a326de"}},{"ruleId":"D2","level":"warning","message":{"text":"serverWatchStream.sendLoop (cognitive 91): serverWatchStream.sendLoop has cognitive complexity 91 (threshold 15). Drivers by points: if/else 67, loops 15, boolean chains 7, match/switch 2 (nesting depth added 55). Of this number, 87 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":"server/etcdserver/api/v3rpc/watch.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dd911908c45783d8a0e186e4b08d637444455bbd06bf45a5797b0b80351150e"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.setupLogging (cognitive 81): Config.setupLogging has cognitive complexity 81 (threshold 15). Drivers by points: if/else 65, loops 12, match/switch 4 (nesting depth added 50). Of this number, 73 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. 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":"server/embed/config_logging.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba0f77ad4d9dd9ed52fa23a2451d0326f6e2209cd4c30a2490d012d2e4ffae60"}},{"ruleId":"D2","level":"warning","message":{"text":"raftNode.start (cognitive 81): raftNode.start has cognitive complexity 81 (threshold 15). Drivers by points: if/else 62, match/switch 14, loops 4, boolean chains 1 (nesting depth added 54). Most of this is not in the body itself: 0 of the 81 points are its own statements and the rest belongs to one function literal inside it that branches (line 177). 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":"server/etcdserver/raft.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"61fa0707a63e80ef275297a3067d5c91c92f435a7089227eed2b02e70175ac46"}},{"ruleId":"D2","level":"warning","message":{"text":"serverWatchStream.recvLoop (cognitive 80): serverWatchStream.recvLoop has cognitive complexity 80 (threshold 15). Drivers by points: if/else 56, match/switch 22, boolean chains 1, loops 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/watch.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"e027b734243a6718c2877beb2bf839209606753bae3ca5ce134258a38feba845"}},{"ruleId":"D2","level":"warning","message":{"text":"command.parseWatchArgs (cognitive 73): command.parseWatchArgs has cognitive complexity 73 (threshold 15). Drivers by points: if/else 56, loops 10, boolean chains 7 (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":"etcdctl/ctlv3/command/watch_command.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa0501c2fcc096a7359cd052d02493f2b24cd7250dfdc0652afabde13772b70c"}},{"ruleId":"D2","level":"warning","message":{"text":"server.ioCopy (cognitive 73): server.ioCopy has cognitive complexity 73 (threshold 15). Drivers by points: match/switch 42, if/else 30, loops 1 (nesting depth added 45). 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":"pkg/proxy/server.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"d39259311d032463b080170a59c1310bcc6636f663bc9e1c32fc85ad9533767b"}},{"ruleId":"D2","level":"warning","message":{"text":"server.listenAndServe (cognitive 63): server.listenAndServe has cognitive complexity 63 (threshold 15). Drivers by points: match/switch 43, if/else 19, loops 1 (nesting depth added 43). 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":"pkg/proxy/server.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"9409173596713452f6e64bfa5f72d7cf6eeae6ec30fdff09fc4a6fa045198a69"}},{"ruleId":"D2","level":"warning","message":{"text":"main.checkFileForExperimental (cognitive 61): main.checkFileForExperimental has cognitive complexity 61 (threshold 15). Drivers by points: if/else 44, loops 8, match/switch 5, boolean chains 4 (nesting depth added 35). Of this number, 17 points are the body\u0027s own statements and 44 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":"tools/check-grpc-experimental/main.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc2b2e1fdaa7edc402b54f909c9776e31d2f3aa2c2c68495d3261ef51a8397bf"}},{"ruleId":"D2","level":"warning","message":{"text":"RaftCluster.ValidateConfigurationChange (cognitive 58): RaftCluster.ValidateConfigurationChange has cognitive complexity 58 (threshold 15). Drivers by points: if/else 39, loops 17, boolean chains 1, match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"fba129a6d023c781b62977bae093ae04f1bc99ca31827411522448274bea0ce2"}},{"ruleId":"D2","level":"warning","message":{"text":"serveCtx.serve (cognitive 54): serveCtx.serve has cognitive complexity 54 (threshold 15). Drivers by points: if/else 50, boolean chains 2, match/switch 2 (nesting depth added 27). Of this number, 48 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":"server/embed/serve.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"78bf67c422b8ae7b3cfcfc1faefe9973bd227672de77f4165d9399d37392f942"}},{"ruleId":"D2","level":"warning","message":{"text":"streamWriter.run (cognitive 52): streamWriter.run has cognitive complexity 52 (threshold 15). Drivers by points: if/else 45, match/switch 5, boolean chains 1, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce338b012a0695e679c5fb9408a1432facccca984f47ba9cccdb821b7a5deb82"}},{"ruleId":"D2","level":"warning","message":{"text":"TLSInfo.baseConfig (cognitive 48): TLSInfo.baseConfig has cognitive complexity 48 (threshold 15). Drivers by points: if/else 37, loops 6, boolean chains 5 (nesting depth added 13). Of this number, 24 points are the body\u0027s own statements and 24 belong to 5 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":"client/pkg/transport/listener.go"},"region":{"startLine":368}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7dd60c461c4ec5a13fc1fb0906312d98897196b0db6c0be1fea89136dc46bd9"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 47): main.main has cognitive complexity 47 (threshold 15). Drivers by points: if/else 40, loops 6, boolean chains 1 (nesting depth added 28). Of this number, 31 points are the body\u0027s own statements and 16 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":"tools/etcd-dump-metrics/main.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"20e92cda493e41069090e47b1589b81b336dd8ba7ee244a4f9fb8e1642b6a9e7"}},{"ruleId":"D2","level":"warning","message":{"text":"main.parse (cognitive 47): main.parse has cognitive complexity 47 (threshold 15). Drivers by points: if/else 36, loops 9, 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":"tools/etcd-dump-metrics/metrics.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"757629bdc8aeb26541392c686c89eb455a38de9559c1ddfc43399305c0806209"}},{"ruleId":"D2","level":"warning","message":{"text":"command.makeMirror (cognitive 47): command.makeMirror has cognitive complexity 47 (threshold 15). Drivers by points: if/else 32, loops 9, boolean chains 3, match/switch 3 (nesting depth added 25). Of this number, 46 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/make_mirror_command.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"37614c52f20f23048320bb4c5d220ffc312b87dd2a43d0deef4049cc0ad2b5f0"}},{"ruleId":"D2","level":"warning","message":{"text":"embed.configureClientListeners (cognitive 46): embed.configureClientListeners has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31, boolean chains 9, loops 6 (nesting depth added 16). Of this number, 43 points are the body\u0027s own statements and 3 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":"server/embed/etcd.go"},"region":{"startLine":645}}}],"partialFingerprints":{"codehealthFindingId/v1":"788128a209240aebe4e0a7b2eabc1ccc9f894b627b4bbd64f83e942371b2e35f"}},{"ruleId":"D2","level":"warning","message":{"text":"v3rpc.checkIntervals (cognitive 43): v3rpc.checkIntervals has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, loops 7, boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/key.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b3df9b96d1e0eb11b358d3e66e6d93b1aeb105a639ab01fe0679b5bfe1fbe16"}},{"ruleId":"D2","level":"warning","message":{"text":"Election.observe (cognitive 41): Election.observe has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21, loops 13, match/switch 6, boolean chains 1 (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":"client/v3/concurrency/election.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"231bb337bfd588614e806669f08b3d37aeea2b8dbcebd68dd821f0ae907e1230"}},{"ruleId":"D2","level":"warning","message":{"text":"WAL.ReadAll (cognitive 41): WAL.ReadAll has cognitive complexity 41 (threshold 15). Drivers by points: if/else 34, boolean chains 3, match/switch 3, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a624050352a52a240b9df7b92d6b579ec24cfc5e94f7e195ef53e1b1934be66"}},{"ruleId":"D2","level":"warning","message":{"text":"watchGRPCStream.serveSubstream (cognitive 40): watchGRPCStream.serveSubstream has cognitive complexity 40 (threshold 15). Drivers by points: if/else 37, match/switch 2, loops 1 (nesting depth added 23). Of this number, 37 points are the body\u0027s own statements and 3 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":"client/v3/watch.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"53aa83d72d112a79725860e52b8fa0acea8347ada7aee3e7e356910403d9ac19"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.Validate (cognitive 40): Config.Validate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31, boolean chains 6, 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/config.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c8024614ca69676dae08a1e4064675aaef9eba36cc6376180b9c4a518c64f00"}},{"ruleId":"D2","level":"warning","message":{"text":"msgAppV2Encoder.encode (cognitive 39): msgAppV2Encoder.encode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35, loops 2, boolean chains 1, match/switch 1 (nesting depth added 22). 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":"server/etcdserver/api/rafthttp/msgappv2_codec.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"a298eeef4e47e967f2f11d8171a83cf229b1c3b3a69acc8d19e7cb06dca4ce99"}},{"ruleId":"D2","level":"warning","message":{"text":"configYAML.configFromFile (cognitive 37): configYAML.configFromFile has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, loops 3, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/config.go"},"region":{"startLine":782}}}],"partialFingerprints":{"codehealthFindingId/v1":"55c78de5d4be2bb861659d30a22e27a22f57599b9f99acd1c090de73a1178c54"}},{"ruleId":"D2","level":"warning","message":{"text":"v3rpc.logUnaryRequestStats (cognitive 37): v3rpc.logUnaryRequestStats has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 8, boolean chains 2, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/interceptor.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"1605076de9e74def2ae5e4ee104ba3786b6743a9ed622e53e67d51dadea20590"}},{"ruleId":"D2","level":"warning","message":{"text":"intervalTree.deleteFixup (cognitive 36): intervalTree.deleteFixup has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/adt/interval_tree.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e438e537b317483ac497860f0bac9a4e5325259318af54efc7385d301da9782"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.rangeFunc (cognitive 35): cmd.rangeFunc has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, boolean chains 4, loops 4, match/switch 4 (nesting depth added 9). Of this number, 25 points are the body\u0027s own statements and 10 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":"tools/benchmark/cmd/range.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bb020874acb452db95ab40b4cc1bf58791c3188a73ae243baaa744d89d6637d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 35): main.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 82). 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":"tools/check-grpc-experimental/main.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"512e71dc249f7f3f1ff0ca355a587ed8b460511d4ab2c0209c693f21a706f8a8"}},{"ruleId":"D2","level":"warning","message":{"text":"main.printRec (cognitive 35): main.printRec has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, match/switch 7, boolean chains 4, loops 4 (nesting depth added 20). 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":"tools/etcd-dump-logs/raw.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"99ca8e094325376dafc3f7a4773637b65d5b25c2dc97bd9df47c4f42ea43ba5f"}},{"ruleId":"D2","level":"warning","message":{"text":"apply.checkTxnReqsPermission (cognitive 34): apply.checkTxnReqsPermission has cognitive complexity 34 (threshold 15). Drivers by points: if/else 31, match/switch 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/apply/auth.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"038dff6e972cfefe8532811feff5869b458ed6125f0290a343d3ede4b3a910d9"}},{"ruleId":"D2","level":"warning","message":{"text":"EtcdServer.LeaseRenew (cognitive 34): EtcdServer.LeaseRenew has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, loops 3, boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/v3_server.go"},"region":{"startLine":488}}}],"partialFingerprints":{"codehealthFindingId/v1":"176fffccf118f71b1142ee20def6fef96c875059d5b75eb21ae048445cf45238"}},{"ruleId":"D2","level":"warning","message":{"text":"fileutil.purgeFile (cognitive 31): fileutil.purgeFile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, loops 6, match/switch 2 (nesting depth added 18). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to one function literal inside it that branches (line 55). 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":"client/pkg/fileutil/purge.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"41ac0b53130135d499ca3b442afb9365da21a44457b4706939524eeb993e6f73"}},{"ruleId":"D2","level":"warning","message":{"text":"clientv3.newClient (cognitive 31): clientv3.newClient has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/client.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"deb9ded6ae3b67108abcb9c9fabd02430548a82c289312394ffa79871a03e6df"}},{"ruleId":"D2","level":"warning","message":{"text":"command.epHealthCommandFunc (cognitive 31): command.epHealthCommandFunc has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17, loops 7, match/switch 5, boolean chains 2 (nesting depth added 14). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 118). 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":"etcdctl/ctlv3/command/ep_command.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdc52ae2c42ae7b210bb49c106c583db2eec41ef5e8b56cafd07e3c59b04191d"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdmain.startEtcdOrProxyV2 (cognitive 31): etcdmain.startEtcdOrProxyV2 has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, match/switch 3, boolean chains 2 (nesting depth added 11). Of this number, 30 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdmain/etcd.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c55510a4f070392a8587c42c84ffb1a0d278138161946d65643ae93d494c72b"}},{"ruleId":"D2","level":"warning","message":{"text":"leaseHandler.ServeHTTP (cognitive 31): leaseHandler.ServeHTTP has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, match/switch 5, loops 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/lease/leasehttp/http.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"3691cffa3eb1efd72beea0e83b34dc78f7845c41cf9ff40d545c97da0a385ef3"}},{"ruleId":"D2","level":"warning","message":{"text":"command.getGetOp (cognitive 30): command.getGetOp has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, boolean chains 3, match/switch 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/get_command.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9d48376a98d1b2704187b0d0c78596262cf77e478cce29d897a955477d2ac18"}},{"ruleId":"D2","level":"warning","message":{"text":"leaseProxyStream.keepAliveLoop (cognitive 30): leaseProxyStream.keepAliveLoop has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, match/switch 7, loops 5 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/lease.go"},"region":{"startLine":276}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6624b4f38d8ce7abffb020e45c516d1ba34360c8b41d5b6ee397f805e8a1763"}},{"ruleId":"D2","level":"warning","message":{"text":"mvcc.restoreIntoIndex (cognitive 30): mvcc.restoreIntoIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 4, boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 0 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 436). 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":"server/storage/mvcc/kvstore.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d7dcf8e3a2aac81b158986b4396ff08d7225a1211cb909a6f3af921047d4acf"}},{"ruleId":"D2","level":"warning","message":{"text":"v3Manager.Status (cognitive 29): v3Manager.Status has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, loops 2 (nesting depth added 12). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 132). 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":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"0686d902ff7205eb97486e83c05acb141c80e7ddbdcd11e962764bd97f9d15a5"}},{"ruleId":"D2","level":"warning","message":{"text":"msgAppV2Decoder.decode (cognitive 29): msgAppV2Decoder.decode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, loops 2, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/msgappv2_codec.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a4eefa856e87da1af3b00f2fc7be1ca7bcf6e12a44656f54bfa25e2b5749a9e"}},{"ruleId":"D2","level":"warning","message":{"text":"streamReader.decodeLoop (cognitive 29): streamReader.decodeLoop has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, match/switch 4, 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":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":471}}}],"partialFingerprints":{"codehealthFindingId/v1":"9760388fe8ff52ed0fa9bdb181ab6257eb0827c59050a7ecb1a55ae3433112bb"}},{"ruleId":"D2","level":"warning","message":{"text":"EtcdServer.rangeStream (cognitive 29): EtcdServer.rangeStream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, boolean chains 1, 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":"server/etcdserver/v3_server.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"99a83e51ebcb2fa0fe8c49f69e95c17b4089fd03969d22b4d2a276915fea303a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 28): main.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 2, loops 1 (nesting depth added 4). Of this number, 26 points are the body\u0027s own statements and 2 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":"tools/local-tester/bridge/bridge.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"e780daf9cc0a401c2b4d378db9013674752532c1876c947d29a188931f393cdb"}},{"ruleId":"D2","level":"warning","message":{"text":"wal.Repair (cognitive 28): wal.Repair has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, match/switch 2, boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/repair.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"503b06bd5537710115724aa6eb0151580d14a51f1eb01cc77c2176a3009088d3"}},{"ruleId":"D2","level":"warning","message":{"text":"lessor.recvKeepAliveLoop (cognitive 27): lessor.recvKeepAliveLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 5, match/switch 2 (nesting depth added 17). Of this number, 26 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/lease.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb7b798ad9c2e6ffb31b33f5194d21fee7865bfb7e9e906863faae382ec5775d"}},{"ruleId":"D2","level":"warning","message":{"text":"streamReader.run (cognitive 27): streamReader.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, match/switch 3, 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":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"7856c0655ca2a96e3421ee6f64fa10923ac6bf6ec3d81d72d5d44a86e36e75c1"}},{"ruleId":"D2","level":"warning","message":{"text":"main.readUsingReadAll (cognitive 26): main.readUsingReadAll has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 3, loops 2, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/etcd-dump-logs/main.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa10c890c3990dfb4387301debb0717f2b18b4229161f4c03ddc023ba204f2bf"}},{"ruleId":"D2","level":"warning","message":{"text":"decoder.decodeRecord (cognitive 26): decoder.decodeRecord has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/decoder.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cd3ab860cece7aa24db28fc751dfb656be17064379edfe6ea3d7ad367978ee6"}},{"ruleId":"D2","level":"warning","message":{"text":"Cache.Watch (cognitive 25): Cache.Watch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, match/switch 10, loops 1 (nesting depth added 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 143). 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":"cache/cache.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c4292867abfa8f82db716adfc9a2e2bee435e9cfc77e8d189be40280caa2cf3"}},{"ruleId":"D2","level":"warning","message":{"text":"transport.isHostInDNS (cognitive 25): transport.isHostInDNS has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, loops 9 (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":"client/pkg/transport/listener_tls.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"e57acf03b04992fd30c6483ccdb67ea98ce06a19dd509ae18d85df49f41f4a87"}},{"ruleId":"D2","level":"warning","message":{"text":"txn.executeTxn (cognitive 25): txn.executeTxn has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, match/switch 2, 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":"server/etcdserver/txn/txn.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"6685d7a50a60ed58c237387b725d7fc871ecda5b70d325ff6abc12f2ff95639c"}},{"ruleId":"D2","level":"warning","message":{"text":"TCPProxy.runMonitor (cognitive 25): TCPProxy.runMonitor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, match/switch 2 (nesting depth added 17). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 205). 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":"server/proxy/tcpproxy/userspace.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ae26ab621eb29e5f0b906e183a851d71ad53deabb6e0ffda411cb64b7fd7e31"}},{"ruleId":"D2","level":"warning","message":{"text":"wal.Verify (cognitive 25): wal.Verify has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 3, match/switch 2, loops 1 (nesting depth added 10). Of this number, 24 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":704}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fc45d46dbfee90bbf6a99723a5b5a5c1330943bb55d55df1aefe4d73af56eb0"}},{"ruleId":"D2","level":"warning","message":{"text":"main.listEntriesType (cognitive 24): main.listEntriesType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 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":"tools/etcd-dump-logs/main.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf6aa5ac25c4e76b25dd05fc8bf38eddaa147773e20a5cfed6ae4dccf232c6c6"}},{"ruleId":"D2","level":"warning","message":{"text":"endpointManager.watch (cognitive 24): endpointManager.watch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, match/switch 6, 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":"client/v3/naming/endpoints/endpoints_impl.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d69664f0b67712950edf00c6c80f89e8e6bcae962221ba33fc47a73ca3024d0"}},{"ruleId":"D2","level":"warning","message":{"text":"embed.StartEtcd (cognitive 24): embed.StartEtcd has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 2 (nesting depth added 4). Of this number, 19 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/etcd.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"90dcc33d20c3a394f5da2d0ad84f13a5a8ed916fd7851ba303369475339b7760"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdserver.getClusterFromRemotePeers (cognitive 24): etcdserver.getClusterFromRemotePeers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"server/etcdserver/cluster_util.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b5b902604ca9c4782bc22a578869bd4a33e789c6ae5f2660bfcd39652b4f3e5"}},{"ruleId":"D2","level":"warning","message":{"text":"EventHistory.scan (cognitive 24): EventHistory.scan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 4, 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":"server/etcdserver/api/v2store/event_history.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"db5adbe0064482e45553619a4dc047ad8eb911fb1f8e0a0f23ba90cc6b7b0d28"}},{"ruleId":"D2","level":"warning","message":{"text":"EtcdServer.applyConfChange (cognitive 24): EtcdServer.applyConfChange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, match/switch 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":"server/etcdserver/server.go"},"region":{"startLine":1996}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc889244e205a95a39777084a7630af5ffc6940c64852dff8dd51850ad4bf5a5"}},{"ruleId":"D2","level":"warning","message":{"text":"EtcdServer.leaseTimeToLive (cognitive 24): EtcdServer.leaseTimeToLive has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, loops 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":"server/etcdserver/v3_server.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dd4bfa46eb48296968a20a1d2e68b88300a0ec6b6243f9667347bd22f081851"}},{"ruleId":"D2","level":"warning","message":{"text":"watchableStore.moveVictims (cognitive 24): watchableStore.moveVictims has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, loops 5, 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":"server/storage/mvcc/watchable_store.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"48e94bb11d377a6018e69504a16bb1e69c9c89448a36702e9453a221692ff64e"}},{"ruleId":"D2","level":"warning","message":{"text":"leasingKV.monitorLease (cognitive 23): leasingKV.monitorLease has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 6, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/leasing/kv.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"7142de4085afb4464765f307c510c0d9599cf099162aac4510f488404f0d54a3"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.Watch (cognitive 23): watcher.Watch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, match/switch 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/watch.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"0086cbc6069b579697656182ae460ef2370f973e3bc05255adca98dffe271bbc"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdmain.startGateway (cognitive 23): etcdmain.startGateway has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 6 (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":"server/etcdmain/gateway.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"54d7651b5116b66fd6146365a553632a3fb34ebb76da613348b80d10a53b03e5"}},{"ruleId":"D2","level":"warning","message":{"text":"main.readRaw (cognitive 22): main.readRaw has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/etcd-dump-logs/raw.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"8455f37746d3d6f1c33cd5480f85923a0aa4918cee3d928e05ebf21e35afa86c"}},{"ruleId":"D2","level":"warning","message":{"text":"command.newCheckPerfCommand (cognitive 22): command.newCheckPerfCommand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, loops 10 (nesting depth added 3). Of this number, 18 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/check.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ab5c88b1508c1590ca34c24557b5f8e0a5459cab10e430c01b4b1bcba6de2d9"}},{"ruleId":"D2","level":"warning","message":{"text":"simplePrinter.RoleGet (cognitive 22): simplePrinter.RoleGet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 2 (nesting depth added 6). Of this number, 18 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":"etcdctl/ctlv3/command/printer_simple.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"68452c2c1d4eb4f02c7971c0cf1efdbb649f15bca4685a0c9cc68356de3267e6"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdmain.startGRPCProxy (cognitive 22): etcdmain.startGRPCProxy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, 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":"server/etcdmain/grpc_proxy.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2110b318cd3af1ed67fd213c7d387e527d7439b06a77292b0ca131d579a8440"}},{"ruleId":"D2","level":"warning","message":{"text":"rafthttp.startPeer (cognitive 22): rafthttp.startPeer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, match/switch 4, loops 2 (nesting depth added 12). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 174, 192, 135). 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":"server/etcdserver/api/rafthttp/peer.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"789aad225b1a9da23ca3c5e7a3ff6f9640c2be33aee1bf554bc307794fca9eec"}},{"ruleId":"D2","level":"warning","message":{"text":"pipeline.handle (cognitive 22): pipeline.handle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 2, 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":"server/etcdserver/api/rafthttp/pipeline.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"10369bf125f4adf34884a6ad29ef7d7f4cf6c6d135d8ca00bfbad0a6383b5728"}},{"ruleId":"D2","level":"warning","message":{"text":"TCPProxy.pick (cognitive 22): TCPProxy.pick has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 5, match/switch 2, 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":"server/proxy/tcpproxy/userspace.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc7990f2c1c5026cb19577f58a1add25b487d05228fe00f5ccfb3a96f113e6a3"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.send (cognitive 22): watcher.send has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 7, boolean chains 1, match/switch 1 (nesting depth added 11). Of this number, 16 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":"server/storage/mvcc/watchable_store.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"5af1cea05bdf82726c6a5c517e335cd5091eaace2dc86369f92ed2e1cce45d26"}},{"ruleId":"D2","level":"warning","message":{"text":"command.memberAddCommandFunc (cognitive 21): command.memberAddCommandFunc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/member_command.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"21dfe96a79f175026f148932ce79acf5595c35ebe10d642a55af3efccc3ba23b"}},{"ruleId":"D2","level":"warning","message":{"text":"v3Manager.copyAndVerifyDB (cognitive 21): v3Manager.copyAndVerifyDB has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":436}}}],"partialFingerprints":{"codehealthFindingId/v1":"0152a1c8497f3d0600e2420d2b3c70b073b7e432ed3362c3f5b8218896d24078"}},{"ruleId":"D2","level":"warning","message":{"text":"command.newCheckDatascaleCommand (cognitive 20): command.newCheckDatascaleCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 9 (nesting depth added 3). Of this number, 17 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/check.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"c38fffe48fd56d9be63f21f8ee4e0b4c12552bb8ac3255a8bc7ab5eee71dd92f"}},{"ruleId":"D2","level":"warning","message":{"text":"command.userAddCommandFunc (cognitive 20): command.userAddCommandFunc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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":"etcdctl/ctlv3/command/user_command.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"586ac9534096cd3cb392a3b9de020c031e4e460bb33bcdd6ad3ae67ea32f4233"}},{"ruleId":"D2","level":"warning","message":{"text":"command.watchInteractiveFunc (cognitive 20): command.watchInteractiveFunc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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":"etcdctl/ctlv3/command/watch_command.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"3af8d910e2e298a8275e2acb5b9a3e1643ebf0abf5d2a1a68acd04f7c8776d14"}},{"ruleId":"D2","level":"warning","message":{"text":"intervalTree.insertFixup (cognitive 20): intervalTree.insertFixup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/adt/interval_tree.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc2919fe7f1a8a16a8a165b0c8bab1e543c01eaff92315f0abf903ca65bfe538"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdhttp.writeError (cognitive 20): etcdhttp.writeError has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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":"server/etcdserver/api/etcdhttp/utils.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"2581fa6a65b383f25fd201fd44143794dea967c3e0067768ef4fa9a5550f8351"}},{"ruleId":"D2","level":"warning","message":{"text":"membership.IsMetaStoreOnly (cognitive 20): membership.IsMetaStoreOnly has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/membership/storev2.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec364dd552eea042c43cfdda18b3b88cd37b4dc647bacdf635d015b8a03a60a8"}},{"ruleId":"D2","level":"warning","message":{"text":"corruptionChecker.checkPeerHashes (cognitive 20): corruptionChecker.checkPeerHashes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/corrupt.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"755898179fc53ceb4d437f9094993aa1347b6860516a3b880bb10d21fc3294b2"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.send (cognitive 20): watcher.send has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/watcher.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"afdaf53750bc7a8bd98d161e8fcc2cf124811ff26cbed9ca784c1d67e34af36d"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.mvccPutFunc (cognitive 19): cmd.mvccPutFunc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 7 (nesting depth added 8). Of this number, 17 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":"tools/benchmark/cmd/mvcc-put.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"599758d458f5ff175dbd157bfd6af34a59fa2bf3d67adcd9f48c88a7a1030020"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.mixedTxnFunc (cognitive 19): cmd.mixedTxnFunc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (nesting depth added 6). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 118, 102). 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":"tools/benchmark/cmd/txn_mixed.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"24e0be45968550d53d9f020ed3efc1183391ee859fe89c29c98425a95085217f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.scanKeys (cognitive 19): main.scanKeys has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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":"tools/etcd-dump-db/scan.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"9161d5ccf68e7496d05aade663b5f271e93a16e0644b6d24845c21960e3a2dd5"}},{"ruleId":"D2","level":"warning","message":{"text":"intervalTree.Insert (cognitive 19): intervalTree.Insert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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":"pkg/adt/interval_tree.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"bebba73c01517ca729737d6306ddb5b7b34627fc707ab32c9f3ce6c909ab690e"}},{"ruleId":"D2","level":"warning","message":{"text":"ExpectProcess.ExpectFunc (cognitive 19): ExpectProcess.ExpectFunc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 4, match/switch 3 (nesting depth added 8). Of this number, 12 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":"pkg/expect/expect.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f408a84c0c965d2432a2f6301b2407f32f04c808576929d6c2122bad4d6ecd7"}},{"ruleId":"D2","level":"warning","message":{"text":"Trace.logInfo (cognitive 19): Trace.logInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, loops 8, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/traceutil/trace.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf840523551f56de4d24bc711fe9cb033eb05452139a9e917d4e2f5b3ae27b0d"}},{"ruleId":"D2","level":"warning","message":{"text":"embed.configurePeerListeners (cognitive 19): embed.configurePeerListeners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 2, boolean chains 1 (nesting depth added 7). Of this number, 14 points are the body\u0027s own statements and 5 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":"server/embed/etcd.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"4791f7694882c3bf8f17d482058a24704556b94054e45666d3d5861df1d7a01e"}},{"ruleId":"D2","level":"warning","message":{"text":"accessController.ServeHTTP (cognitive 19): accessController.ServeHTTP has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"server/embed/serve.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"c72087259f6ec1eab940d67cc6bc2b5fec592365f144e4b85c0a721d0dbf0d58"}},{"ruleId":"D2","level":"warning","message":{"text":"v3rpc.monitorLeader (cognitive 19): v3rpc.monitorLeader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 5, match/switch 2 (nesting depth added 12). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 320). 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":"server/etcdserver/api/v3rpc/interceptor.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7a7f8ec3afa848df1f69607459a8e75a23457a495794879073a539bb1f2bf07"}},{"ruleId":"D2","level":"warning","message":{"text":"LeaseServer.leaseKeepAlive (cognitive 19): LeaseServer.leaseKeepAlive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/lease.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c525c1ddb2adfcf23e1839f0703ec622af0c5a048595fe47b1be0ccc1524ff3"}},{"ruleId":"D2","level":"warning","message":{"text":"Read.requestCurrentIndex (cognitive 19): Read.requestCurrentIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, match/switch 5, 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":"server/etcdserver/read/read.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa55bea7578a7e3a0a955ca32b397afccdf38f78799248e39cc9b65abe26335d"}},{"ruleId":"D2","level":"warning","message":{"text":"EtcdServer.run (cognitive 19): EtcdServer.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 769, 797). 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":"server/etcdserver/server.go"},"region":{"startLine":755}}}],"partialFingerprints":{"codehealthFindingId/v1":"3197cc1f442858ffda2bf0775c3d8c4572e61337cd2e82eec7bd29906732f2dd"}},{"ruleId":"D2","level":"warning","message":{"text":"wal.Create (cognitive 19): wal.Create has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (nesting depth added 1). Of this number, 17 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6a6bab993393f2a9d5d86a8386731816f87d17d1ab6adabcfb1ba31fad2ee76"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.unaryClientInterceptor (cognitive 18): Client.unaryClientInterceptor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 43). 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":"client/v3/retry_interceptor.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"daed6ed27d8000cbedbc43e62fba3043c876e967f57ee0c33511fee39a0cb843"}},{"ruleId":"D2","level":"warning","message":{"text":"command.getDelOp (cognitive 18): command.getDelOp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/del_command.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"c608a3bd940695cf26716e3600f3152270b63dce1db48731a5e339649d2a1aa4"}},{"ruleId":"D2","level":"warning","message":{"text":"flags.verifyEnv (cognitive 18): flags.verifyEnv has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 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":"pkg/flags/flag.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b5bae4b00be881672a50f63b0faa2d3ad172fd7057ca8d190b437d5a3df451d"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdserver.promoteMemberHTTP (cognitive 18): etcdserver.promoteMemberHTTP has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/cluster_util.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"4302a4acc13d90a1778dd127f99c590e22a84d2e966803d3105d01f540c190bf"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdserver.NewServer (cognitive 18): etcdserver.NewServer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 2 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 4 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":"server/etcdserver/server.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"53505d235a0617637fe1c7985a262b9584c1778a4479dec0d951ecc5da8e5657"}},{"ruleId":"D2","level":"warning","message":{"text":"rafthttp.monitorProbingStatus (cognitive 18): rafthttp.monitorProbingStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, 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":"server/etcdserver/api/rafthttp/probing_status.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa82e3fb17fb3b1545fd865d0552426424a2b905a0e980c32c97fa731567328b"}},{"ruleId":"D2","level":"warning","message":{"text":"node.Remove (cognitive 18): node.Remove has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v2store/node.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef8e7092af8d5ddcedc64ed762a1369d5dcd4175de79e598e3391e4b3c8a2fc8"}},{"ruleId":"D2","level":"warning","message":{"text":"corruptionChecker.InitialCheck (cognitive 18): corruptionChecker.InitialCheck has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/corrupt.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"1189ca4aa86320642431c2af984b75e122b1011c1ef774e1b6561ef4960547c6"}},{"ruleId":"D2","level":"warning","message":{"text":"raftNode.processMessages (cognitive 18): raftNode.processMessages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, loops 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":"server/etcdserver/raft.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa8671d59a6fb0f96b3171fe023d85aecf0a0e59612e1a1127f618a9e2016571"}},{"ruleId":"D2","level":"warning","message":{"text":"backend.defragdb (cognitive 18): backend.defragdb has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 8). Of this number, 9 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":"server/storage/backend/backend.go"},"region":{"startLine":616}}}],"partialFingerprints":{"codehealthFindingId/v1":"5576b7aa9333b58f5650bfaa8c7451547e5c3ea5f48b5a90e2ee6b77b1bd8958"}},{"ruleId":"D2","level":"warning","message":{"text":"store.restore (cognitive 18): store.restore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/mvcc/kvstore.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"45d1340717b247185bc8226ccea5d47dd0f49940aa280174b2873eba572f8cf9"}},{"ruleId":"D2","level":"warning","message":{"text":"watchableStore.syncWatchers (cognitive 18): watchableStore.syncWatchers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, loops 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":"server/storage/mvcc/watchable_store.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cfe5f2b57e83c2c870f3a053185cd04afb3a49eeaa2d6501b1363fa81d824ea"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.watchLatencyFunc (cognitive 17): cmd.watchLatencyFunc has cognitive complexity 17 (threshold 15). Drivers by points: loops 10, if/else 7 (nesting depth added 8). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. 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":"tools/benchmark/cmd/watch_latency.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"32d1bba04d5a2fddb9d2e91f6ceeebafe427035fe605184c4571704cd3a2c27a"}},{"ruleId":"D2","level":"warning","message":{"text":"srv.GetCluster (cognitive 17): srv.GetCluster has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 51). 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":"client/pkg/srv/srv.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"4103e0040b19fa1203ad230600ed96268af7b2e50c6410985ccfb10267a8d640"}},{"ruleId":"D2","level":"warning","message":{"text":"TLSInfo.ClientConfig (cognitive 17): TLSInfo.ClientConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 6). Of this number, 13 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, 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":"client/pkg/transport/listener.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e243aabc007088c76dbfb8ed81eceeded032306921593418cc8534cfb5b63f"}},{"ruleId":"D2","level":"warning","message":{"text":"lessor.closeRequireLeader (cognitive 17): lessor.closeRequireLeader 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":"client/v3/lease.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"861038b5ec11b122b29205d53b6f3f6589d13541b9dcb296d69f177da79de231"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.getMergedPerms (cognitive 17): auth.getMergedPerms has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 3, match/switch 3, 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":"server/auth/range_perm_cache.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"4969f6be9533a192d54fabd806920f5935b0f6330eef1e3d89d5c6b67f6a5fd5"}},{"ruleId":"D2","level":"warning","message":{"text":"config.parse (cognitive 17): config.parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdmain/config.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea22d9cfd976ec1b229271dede9665b16664a480f8da4f674d61b5156a67575b"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdserver.recoverSnapshot (cognitive 17): etcdserver.recoverSnapshot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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":"server/etcdserver/bootstrap.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bafceea8a9309c9196cdfe41c548c33962edf22540c152dd79f77ff3b528299"}},{"ruleId":"D2","level":"warning","message":{"text":"streamReader.dial (cognitive 17): streamReader.dial has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 4, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":569}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8d5984610c996db90d412d4c8c551de7d226414534c9bb46d8f09f6b179c714"}},{"ruleId":"D2","level":"warning","message":{"text":"Periodic.Run (cognitive 17): Periodic.Run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 105). 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":"server/etcdserver/api/v3compactor/periodic.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3d34511e52bf46c2675f5515913fbd12e4b15035eff5b90f25678f734023e46"}},{"ruleId":"D2","level":"warning","message":{"text":"storeTxnCommon.rangeKeys (cognitive 17): storeTxnCommon.rangeKeys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/mvcc/kvstore_txn.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc80d29b1dda1c6c12e35c7dc1a4030c04edb554095d28515d3d0e258ec1e48e"}},{"ruleId":"D2","level":"warning","message":{"text":"chart.addValues (cognitive 17): chart.addValues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (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":"tools/rw-heatmaps/pkg/chart/line_chart.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3c12fad1493e77064146b4b1996e356c557b34fa823ff4cf8d0b8f82d3124cb"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.processRow (cognitive 17): cmd.processRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/testgrid-analysis/cmd/data.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c8cea1950b1cc179274c252326db856395c20e89acfb79bea00b16e230f78a8"}},{"ruleId":"D2","level":"warning","message":{"text":"cmd.stmFunc (cognitive 16): cmd.stmFunc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, loops 6, boolean chains 2, match/switch 1 (nesting depth added 4). Of this number, 8 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/benchmark/cmd/stm.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"86276548879bf8ce5a1c506cfea9c1a08bdd5a4873a12329d13121989a914859"}},{"ruleId":"D2","level":"warning","message":{"text":"Cache.validateRange (cognitive 16): Cache.validateRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cache/cache.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb095de29dcc7a01a13e46ccbad38ce55048286343811f31562a06438701617a"}},{"ruleId":"D2","level":"warning","message":{"text":"demux.updateStoreLocked (cognitive 16): demux.updateStoreLocked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"cache/demux.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccfd31f37b2707595f15d0c7ab8214d19d86285d0ec81203e65afb9e349b7e9f"}},{"ruleId":"D2","level":"warning","message":{"text":"transport.SelfCert (cognitive 16): transport.SelfCert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/pkg/transport/listener.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc3f05d247aa7fb61803306089f52d1cf524d964d6866a3cfd1fe3b88332e5ea"}},{"ruleId":"D2","level":"warning","message":{"text":"DoubleBarrier.Leave (cognitive 16): DoubleBarrier.Leave has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"client/v3/experimental/recipes/double_barrier.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"916a95a36a891b39ff6be1b4cef17306249422e9ef96cb1ed19382cb5948cf07"}},{"ruleId":"D2","level":"warning","message":{"text":"leasing.evalCmp (cognitive 16): leasing.evalCmp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"client/v3/leasing/util.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"f154b35996e06c0321dc4607d9dd238ca758fb3c27759b8cbc78dc49c57148ed"}},{"ruleId":"D2","level":"warning","message":{"text":"v3Manager.Restore (cognitive 16): v3Manager.Restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2ed6332711152210d3c355d10751ffa82cc11fb33c37aff472f1f0ee0e275c1"}},{"ruleId":"D2","level":"warning","message":{"text":"Etcd.Close (cognitive 16): Etcd.Close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 7, boolean chains 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/etcd.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"b12053dfca7474e6ce6289828a833ae1b051c9e10316a5d4229691843a92c44c"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdserver.openWALFromSnapshot (cognitive 16): etcdserver.openWALFromSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"server/etcdserver/bootstrap.go"},"region":{"startLine":628}}}],"partialFingerprints":{"codehealthFindingId/v1":"c78dcd0f675dd672666f2957707e784242ef9b45c6b79929dd3189a454f8ecf9"}},{"ruleId":"D2","level":"warning","message":{"text":"Snapshotter.ReleaseSnapDBs (cognitive 16): Snapshotter.ReleaseSnapDBs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/snap/snapshotter.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"c108e12bb651ffe6677a63a50b94f6ea357ddd41c0c92b8b6394fc2a735c76b5"}},{"ruleId":"D2","level":"warning","message":{"text":"corruptionChecker.PeriodicCheck (cognitive 16): corruptionChecker.PeriodicCheck has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 4). Of this number, 15 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/corrupt.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"002553a9e7a2226b37c8aad6864f270ed8390e0f2be774ccc7e25b56060f82a2"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: EtcdServer: TooManyMethods \u2014 161 methods, declared across 5 files: etcdserver/server.go (103), etcdserver/v3_server.go (47), etcdserver/interface.go (7), etcdserver/corrupt.go (3), \u002B1 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":"server/etcdserver/server.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b24a52e1c50bb2d644b32aaeda532b173343def03a95156020586384ee4251e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: etcdserver/server.go: FileTooLong \u2014 1448 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":"server/etcdserver/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"14882ed81aadea9e2dc9e694d1f3d50d0b4dc1e31f1fa0c8531637cc3a0af171"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: etcdserver/v3_server.go: FileTooLong \u2014 817 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":"server/etcdserver/v3_server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"30e09d32c99252c3017267babcb7815e04d598e12bca30acf0478ccf03fe0bc6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: embed/config.go: FileTooLong \u2014 781 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":"server/embed/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f59a4805b5a8e748f926b1208e981fb8f51eb30dc16b4beaa7d732afebf21169"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: auth/store.go: FileTooLong \u2014 741 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":"server/auth/store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c018c3a6ef8d950182b99e21d05264851255d017ef783d9cb2f677f9f89276ef"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: proxy/server.go: FileTooLong \u2014 656 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":"pkg/proxy/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a4ac126150938624ebdca02ec51e51a23ddb0073f6154fb3a004f7e0b8587f3"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: authStore: TooManyMethods \u2014 39 methods, declared across 2 files: auth/store.go (37), auth/range_perm_cache.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. Most of these members implement auth.AuthStore (31 of 39 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":"server/auth/store.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f1be5158ca5bf2ad40dd4514a3f425bda66ee348305dc175b7a105d2a0b7fd8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: wal/wal.go: FileTooLong \u2014 629 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":"server/storage/wal/wal.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8e51ebc4495e27fde7c5479ed8ea444967c72637f24dcca51c56e2692a71d6e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: v3/watch.go: FileTooLong \u2014 619 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":"client/v3/watch.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e61b2381b94cbaf2b7d9c3a0ffb8157f5bb3aed0605b3234229f11b070fba4df"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: simplePrinter: TooManyMethods \u2014 37 methods. Most of these members implement command.printer (37 of 37 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":"etcdctl/ctlv3/command/printer_simple.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"4eaa04218b1d2c1d870625a6abbc34fe291a1e230ac0cbc075f626b134a3bb21"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: embed/etcd.go: FileTooLong \u2014 605 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":"server/embed/etcd.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0612baedac163b5d27b6059e0c4af0a274461db3141cfe03e3826be5f27ca32a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: membership/cluster.go: FileTooLong \u2014 590 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":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e733b3d3a83c7ab2e443395b9b7dc69a640d21fd44bb212eb628528f6ef5097"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Op: TooManyMethods \u2014 35 methods. 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":"client/v3/op.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"22466324c65c015d64cb8481cfb8dadef652cc93e6461235ad98d78764fcc5d8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: RaftCluster: TooManyMethods \u2014 35 methods. 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":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"b20d1c145c3c3e96e81571272e19f16cc24a448eec0981710064908cdf8e59a5"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: printerRPC: TooManyMethods \u2014 34 methods. Most of these members implement command.printer (34 of 34 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":"etcdctl/ctlv3/command/printer.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"b25dc2a4279095f87a466bc1ef1e7e8c1d23e0f33b894ed976839d374b4abc9e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: server: TooManyMethods \u2014 34 methods. Most of these members implement proxy.Server (30 of 34 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":"pkg/proxy/server.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c85efec1e128cc5459f248270c17cc667076d891267d140e73fcdef37c8170d"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: applierV3backend: TooManyMethods \u2014 31 methods. Most of these members implement apply.applierV3 (30 of 31 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":"server/etcdserver/apply/backend.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"33391f9a6ba3b8cce329500681398ff8d43820cb824a933ae57b25beccd8ab93"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: etcdserver/bootstrap.go: FileTooLong \u2014 512 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":"server/etcdserver/bootstrap.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"50f7d8ae5ea7e0b4cd7684c19f474178f00a59e9fce649a08b07c6af64c4861f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): server/auth/options.go:135-155 | server/auth/options.go:173-193 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/auth/options.go:135\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/auth/options.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"b12177524b33bff7d81a1060894105be9dadb446d6a308d405d461b1c9b8c270"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): server/etcdserver/api/v2store/node.go:273-290 | server/etcdserver/api/v2store/node_extern.go:44-60 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v2store/node.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"d37f5803147f4c428dcff96d7a5e54dc2c7dffa42976e947756645571837b8f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): client/v3/experimental/recipes/priority_queue.go:50-64 | client/v3/experimental/recipes/queue.go:47-61 \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 \u0060client/v3/experimental/recipes/priority_queue.go:50\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":"client/v3/experimental/recipes/priority_queue.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"a431a08c261916522adaa5c2f8d52f842240aa336911944e3b6c4ee6fd42b54a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): server/proxy/grpcproxy/lease.go:162-175 | server/proxy/grpcproxy/watch.go:113-129 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/proxy/grpcproxy/lease.go:162\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/lease.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9eb5f519e443769693c45f7614c64211ee8adea8d0ace6cc76584c0437d30dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): server/storage/wal/wal.go:649-662 | server/storage/wal/wal.go:723-736 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/storage/wal/wal.go:649\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/wal/wal.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9c5a9aa390ea60bd2157f8cf32407eb16e15a4a06dc170918d3210924c0e3f4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): server/auth/store.go:625-637 | server/auth/store.go:738-750 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/auth/store.go:625\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/auth/store.go"},"region":{"startLine":625}}}],"partialFingerprints":{"codehealthFindingId/v1":"db490cf2cdf05c91e86d6792a0ac30ec79a594b27bd32cd3d70b4239ddc30a4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): server/etcdserver/cluster_util.go:245-257 | server/etcdserver/cluster_util.go:385-397 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/cluster_util.go:245\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/cluster_util.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"0810fbf96de6498bc37e15108592ea3cd5f252199a68218335a46e308c63bafc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): server/etcdserver/api/v3discovery/discovery.go:279-290 | server/etcdserver/api/v3discovery/discovery.go:386-397 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/v3discovery/discovery.go:279\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3discovery/discovery.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b196ff7eade2992ee057d66fa80c409bded4da2f2d4d5f6c98a4d0636cca937"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): server/etcdserver/cluster_util.go:265-276 | server/etcdserver/cluster_util.go:405-416 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/cluster_util.go:265\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/cluster_util.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"3efb0a4d09bed746d7f0d72cb77802907a0d0d8808a0e0b3cbbfe7b29089d593"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): tools/rw-heatmaps/pkg/chart/heatmaps.go:93-105 | tools/rw-heatmaps/pkg/chart/heatmaps.go:172-183 \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 \u0060tools/rw-heatmaps/pkg/chart/heatmaps.go:93\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":"tools/rw-heatmaps/pkg/chart/heatmaps.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"199d448310cfd33c9a9f81a32a03c2a59d006a5d645c85aa62d95d062f52c7d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): tools/etcd-dump-db/main.go:84-94 | tools/etcd-dump-db/main.go:144-154 \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 \u0060tools/etcd-dump-db/main.go:84\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":"tools/etcd-dump-db/main.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"9137fad5b686a7fe67cb1e329caf3fa463b630485d2d18d735d905047bfa42ec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): client/v3/experimental/recipes/priority_queue.go:69-79 | client/v3/experimental/recipes/queue.go:66-76 \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. 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":"client/v3/experimental/recipes/priority_queue.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"7878540d304343dec6624462c0c1866263d4849a33d094f8bec91b7d70650baa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): client/v3/kubernetes/client.go:88-100 | client/v3/kubernetes/client.go:114-124 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060client/v3/kubernetes/client.go:88\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":"client/v3/kubernetes/client.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"15dc309f3c436077c4204d37a9739936c34dea96e772ee2286e400f3f2f2e804"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/lease/leasehttp/http.go:81-91 | server/lease/leasehttp/http.go:112-124 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/lease/leasehttp/http.go:81\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/lease/leasehttp/http.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f0c578ec7736ae6dae03f0c4026196421f3399e9588b1751756830d2a1b099f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): server/proxy/grpcproxy/lease.go:64-74 | server/proxy/grpcproxy/watch.go:66-76 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/proxy/grpcproxy/lease.go:64\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/proxy/grpcproxy/lease.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"9028696d1ec5e68b4a03d3fb7a2529cf5a024806edfc965ea1eddbe4bbffccff"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): tools/etcd-dump-db/main.go:105-114 | tools/etcd-dump-db/main.go:123-132 \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 \u0060tools/etcd-dump-db/main.go:105\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":"tools/etcd-dump-db/main.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"44f7f9e930ab0a321a440604c99a5ebecd01c7b9a614d611a6ae5acf0c7b769f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): client/v3/concurrency/mutex.go:54-63 | client/v3/concurrency/mutex.go:77-86 \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":"client/v3/concurrency/mutex.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3a72375c60d90769fd6d4eb26341acdbec4e0cd6e32f14674dd8a2aa94147cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): etcdctl/ctlv3/command/downgrade_command.go:80-89 | etcdctl/ctlv3/command/downgrade_command.go:106-115 \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":"etcdctl/ctlv3/command/downgrade_command.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"f82fc59483b21c6e5249bdd72fbb5dade4a781e803d27ec9ee1c43a2fd18aae0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): etcdctl/ctlv3/command/elect_command.go:110-119 | etcdctl/ctlv3/command/lock_command.go:83-92 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060etcdctl/ctlv3/command/elect_command.go:110\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":"etcdctl/ctlv3/command/elect_command.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"93d93d62c2ce4d2fc07058c4d42e749d8f0d90c63f08e6fc315c007b39655e23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/adt/interval_tree.go:293-303 | pkg/adt/interval_tree.go:656-665 \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 \u0060pkg/adt/interval_tree.go:293\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":"pkg/adt/interval_tree.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"07c646a51d43bd4d20b715b1b19f75425b3593de76e3115c4a3921a4a446ed46"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): server/storage/schema/membership.go:193-202 | server/storage/schema/membership.go:213-223 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/storage/schema/membership.go:193\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/storage/schema/membership.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"fad52d6ecd88452dfac0bdd63b59b7607654a819465f6e0e0332cc173601278b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): tools/rw-heatmaps/pkg/chart/heatmaps.go:137-146 | tools/rw-heatmaps/pkg/chart/heatmaps.go:219-228 \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 \u0060tools/rw-heatmaps/pkg/chart/heatmaps.go:137\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":"tools/rw-heatmaps/pkg/chart/heatmaps.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa8f582ed4081f333bdcbd23fcb7b09088edac81f24eae04d3f5553c170dfa3d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): tools/rw-heatmaps/pkg/chart/line_chart.go:188-197 | tools/rw-heatmaps/pkg/chart/line_chart.go:202-211 \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":"tools/rw-heatmaps/pkg/chart/line_chart.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"097de6382e436cf4fc089f907c2e3f973fe72c6ad45d28c5299a3d8d526f5f66"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): etcdctl/ctlv3/command/completion_command.go:70-78 | etcdutl/etcdutl/completion_commmand.go:70-78 \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 \u0060etcdctl/ctlv3/command/completion_command.go:70\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":"etcdctl/ctlv3/command/completion_command.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bb097e190786f97816a1183fe297d9ef6725f89b05cb3ca4a3f71e820f96198"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): etcdctl/ctlv3/command/elect_command.go:69-77 | etcdctl/ctlv3/command/elect_command.go:103-111 \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":"etcdctl/ctlv3/command/elect_command.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"088c4848de29547740979180ac07ddec6b8849192880fac5f76a71c00764d1d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): etcdctl/ctlv3/command/member_command.go:188-196 | etcdctl/ctlv3/command/member_command.go:251-259 \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 \u0060etcdctl/ctlv3/command/member_command.go:188\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":"etcdctl/ctlv3/command/member_command.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7fe8d4951f32aec62aa8d2153ee63ec60f9b10060175b4e56fbe898685f9b44"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/etcdserver/server.go:1461-1469 | server/etcdserver/v3_server.go:671-680 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/server.go:1461\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/server.go"},"region":{"startLine":1461}}}],"partialFingerprints":{"codehealthFindingId/v1":"7610f786e6ed59ba3027142b1d79c251feff7f1dad92d2d90877b2f5e5b34659"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): server/etcdserver/v3_server.go:892-900 | server/etcdserver/v3_server.go:917-925 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/v3_server.go:892\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/v3_server.go"},"region":{"startLine":892}}}],"partialFingerprints":{"codehealthFindingId/v1":"c89cf17160ee33e202049e6874db99ce80cc293193723832ed18f801123219d8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/etcdserver/api/rafthttp/stream.go:198-205 | server/etcdserver/api/rafthttp/stream.go:227-234 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"77906d2f0793ba46fa7033ce34f6d747b3b61e97e23bd31b4d6a03b5e5986e7c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/etcdserver/api/v3election/election.go:61-68 | server/etcdserver/api/v3election/election.go:111-118 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3election/election.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c3d0872c67df99e84861d56dd8ba0f5b9be3f6672c802320e174a3f917d6dbc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): server/etcdserver/api/v3rpc/interceptor.go:191-198 | server/etcdserver/api/v3rpc/interceptor.go:207-214 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/v3rpc/interceptor.go:191\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/interceptor.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"45638dba9ce917c8a0172479490a048456e46f35799cb2719ab9b862b15512bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 6): etcdctl/ctlv3/command/printer_table.go:30-36 | etcdctl/ctlv3/command/printer_table.go:41-47 | etcdctl/ctlv3/command/printer_table.go:52-58 | etcdctl/ctlv3/command/printer_table.go:63-69 | etcdutl/etcdutl/printer_table.go:30-36 | etcdutl/etcdutl/printer_table.go:41-47 \u2014 there are 6 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/printer_table.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"acb3988ac239b8f3d7c610ddf2c808ef554a0640a73eefec46a0be73452084d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): client/v3/maintenance.go:231-237 | client/v3/maintenance.go:274-280 \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":"client/v3/maintenance.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"30ce3fe39c1a14227ec6451f92a12f4c0bb958d5566a55fc836868e771be14db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): etcdctl/ctlv3/command/check.go:191-197 | etcdctl/ctlv3/command/check.go:373-379 \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 \u0060etcdctl/ctlv3/command/check.go:191\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdctl/ctlv3/command/check.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ad58bbf64adf8a075e6d1b59c0364304697b79fa628dc7cae9aee48305b18df"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): server/etcdserver/api/rafthttp/http.go:107-113 | server/etcdserver/api/rafthttp/http.go:215-221 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/rafthttp/http.go:107\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/http.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c3199a88d643aa8aaf98fa1dffe6d22d50027310fa73bfbab0079ddd04a7611"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): server/etcdserver/corrupt.go:137-143 | server/etcdserver/corrupt.go:148-154 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/corrupt.go:137\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/corrupt.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe9e186902b1dbb47a440305e7b34f402c30b50071bdddba9746ec712e8f9ad2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): tools/rw-heatmaps/pkg/chart/heatmaps.go:279-285 | tools/rw-heatmaps/pkg/chart/heatmaps.go:305-311 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/rw-heatmaps/pkg/chart/heatmaps.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"94bf8a9cfa6bd9fc0ff729ae84f8855aabba6058462d0e6d2e20db835d74537e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): etcdctl/ctlv3/command/printer_fields.go:93-98 | etcdctl/ctlv3/command/printer_simple.go:68-73 \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 \u0060etcdctl/ctlv3/command/printer_fields.go:93\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":"etcdctl/ctlv3/command/printer_fields.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"725643f91f81ff54ff7d085d639c319911722ef48425dd1b3cd833cb9a168429"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): server/etcdserver/api/membership/cluster.go:563-568 | server/etcdserver/api/membership/cluster.go:572-577 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/membership/cluster.go:563\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb73d3a9b12914f12cab33f594ef504f129c8e2a273699d53366ff1c85d66a45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): server/etcdserver/api/rafthttp/remote.go:64-69 | server/etcdserver/api/rafthttp/remote.go:75-80 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/rafthttp/remote.go:64\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/remote.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"223f23ac021929cf34af19aafc9f306825cc45c0be3087ad02fec6deb4101ee8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): server/etcdserver/api/rafthttp/stream.go:540-544 | server/etcdserver/api/rafthttp/stream.go:551-555 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060server/etcdserver/api/rafthttp/stream.go:540\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":540}}}],"partialFingerprints":{"codehealthFindingId/v1":"06e0da49c4de2e4c29234fb214472914632a2d6db4125a2d481759833ad88620"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/storage/wal/wal.go: server/storage/wal/wal.go changed 6 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":"server/storage/wal/wal.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8dee760dd377651d8ee7d34d1d4b622437a44a699400d1b5e7ade07b0c0d5bd"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/api/membership/cluster.go: server/etcdserver/api/membership/cluster.go changed 5 times in last 90 days, max complexity 26. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/membership/cluster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd75e0c98e077c596080f61e894ca34dd63d5ee961725629ade37dac45eb9de8"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/server.go: server/etcdserver/server.go changed 7 times in last 90 days, max complexity 17. 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":"server/etcdserver/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"46186464a048b80afdaf920982fa06d23c64e1cb835a60f99beed36c4dd705f2"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/api/rafthttp/stream.go: server/etcdserver/api/rafthttp/stream.go changed 5 times in last 90 days, max complexity 23. 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":"server/etcdserver/api/rafthttp/stream.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3640aa4eeb91ea14855cd2846341e22c35fb6d4db657c55c677a7d2c99c47f9f"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/api/v3rpc/watch.go: server/etcdserver/api/v3rpc/watch.go changed 3 times in last 90 days, max complexity 36. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v3rpc/watch.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"46e5501163a597c3ea3a8f5f0659fdff6784ea9699e991c78ba7b0dce543da0e"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/raft.go: server/etcdserver/raft.go changed 3 times in last 90 days, max complexity 31. 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":"server/etcdserver/raft.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"edfbd27188d23eca51d1fea50cdd1b671925856de7edd684670e7e7eb0a013df"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: server/etcdserver/v3_server.go: server/etcdserver/v3_server.go changed 3 times in last 90 days, max complexity 31. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/v3_server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b1418f41f6c759fa6e2716266669b0390ef2a3216d1671d6af8de673e7122be"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: tools/etcd-dump-logs/main.go: tools/etcd-dump-logs/main.go changed 5 times in last 90 days, max complexity 17. 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":"tools/etcd-dump-logs/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"517aa98f4ebfcd31c9461843e49e50a58fe08652f0f8fbb8cd86e0ef7ed5b233"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: etcdutl/snapshot/v3_snapshot.go: etcdutl/snapshot/v3_snapshot.go changed 4 times in last 90 days, max complexity 18. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"etcdutl/snapshot/v3_snapshot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d52ef33ce1c72e9a451e8a8412d63e0ffe2db97ea184c0ff36a7a538f9dfc327"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: etcdctl/ctlv3/command/get_command.go: etcdctl/ctlv3/command/get_command.go changed 2 times in last 90 days, max complexity 32. 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":"etcdctl/ctlv3/command/get_command.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"260e7c940c72714013679f589cf6bebd8b253da30be33483650cebd662cbe9a4"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: server/etcdserver/api/rafthttp/transport.go, server/etcdserver/api/rafthttp/peer.go, server/etcdserver/read/read.go, server/etcdserver/api/rafthttp/msgappv2_codec.go, server/etcdserver/api/rafthttp/remote.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"840aa519ee939cf5000b41eed1073c4c029bb2465523f77d82441c7c1ad9e2b5"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #2: If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: server/embed/serve.go, client/pkg/transport/listener_tls.go, server/storage/quota.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"534920b4db5485e701950c41cc436aef69e7b3bc284ab36e34b127e60596f4c3"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #3: If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: client/v3/leasing/util.go, client/v3/mirror/syncer.go, server/proxy/grpcproxy/watcher.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3a4b4ae95e602539b3a2819801287f10fa46c960616b867eb3a3f76196706f56"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 4 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold \u2014 folded into the bus-factor score and metrics (16 single-owned of 300 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D19","level":"note","message":{"text":"The container images section claims these are not used to build the project but does not link to the actual dependency-updating machinery or GitHub actions that do bump versions, leaving the reader unsure how this is integrated into the CI workflow.: Add a brief sentence stating which tools actually drive version bumps (e.g. Dependabot) and where to find the GitHub action definition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"tools/container-images/README.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ae6fb11251d66793bda5a07d1c08939bf67f44cd936fb5cc55f396fe5dd94d1"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6acac8d13b65da2e5dc11e68e7b4bc03a99e409e4a35f916359477450f4828c5"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"47b7d37948131c9aebd72520f5dc38bbbfdb144994d2fff940438f63985ccd2e"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e0ec6d7b46024ddc2e6ca097d3407dfc85c76c1d76a225db7ee78e8f219995a6"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"725fc93e54bf1fc4b19cd8ff2492adc3467901a081897560aec9b55c244a027f"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"129ca65bd50b6e6a2223299bf5cae5959136a4bca76cb3e2b796138647f5a498"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"73b7a009f87aa38f8f5250dbec2030d1b3ff26d96fe07bcdc20c3f93ee830772"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f7cd35590f097453a7f3408ab1bdbd212928da464f3aa15c4943f04f54112349"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"09f7b32f0ade5a8ce79e89e8098d019916df993cd3d76dec97574a172871fe42"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"257f8a8b7850ff146d5f99d5b45ed8ca79b8753d980ab80c3de3710e8532942e"}},{"ruleId":"D28","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3cdfd7beb31b791ae18dcb425e21eb157c842e7bbcd522cc330573c1a6538db1"}},{"ruleId":"D31","level":"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":"fe2d688610b51e0a5a02c7c5dd1724a4986e40f2689fb84510e2ec0164c27d6a"}},{"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":"314cc3e73dcb114ce4e5c50a851f618815a84535f1bf7447b407b6feaae40380"}},{"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":"b6222483549974f49ed99e918e72195d2a10801e3830d99b98e7bc354f086f3b"}},{"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":"3121d4fef466a1fd3b18812c044030e684e0247e5dab72150ba59c9cdc786b72"}},{"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":"e26e14a556e8db896e5e2c613218aff55190e53241a6675d4d50d3b627b43fce"}},{"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":"b2dbba4e5c90601a6c080ca9fb65152dedebe142f25decc61ce8b30bf02fb10c"}},{"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":"4d6b2e4ae4e1c93387d5b2e5e1d1de339185ca70c44cccc51a3f3e9f0c04b8d2"}},{"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":"487df44de00215ef25d736ff5e4821f31c24e6a7257b53c1c49d9d865c46d8f8"}},{"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":"d3dfb2d1a1ee36637f3c98846f1d19378cdcd8dd61ee5d0d2fd3143870a19dd2"}},{"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":"6b842fa2bae4aece1a2b315bbaff86e0cb50d74e2e8813616f6e5c436bd4afd2"}},{"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":"db589ce67aa8f72c338aa2ff32484414d963c93f27032695bf36cd97aae4acb3"}},{"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":"09e39e5fdf59ce57e0c8b0a4b96fe20b1de0c06fc7d8c106d242f756789a453e"}},{"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":"53cd9f0645600ef3aa4d0734e2ecb476c753b19b52fc83382014892675d2afde"}},{"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":"566a567a907ff4264038ad97e0944a7b0ffc7ddeab481fad299ed903ad2d1034"}},{"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":"bcf420758ea20d7fbca2750e41b73cff0f1317c17f193bb48d524d0dd155a911"}},{"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":"e99cc45483ba82f2cc4f86b0afcd40ae32ddc40c8d378040f26e47e7f3668994"}},{"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":"eef1ae987039af8f4fd475c8112bc4428f8318c88f7d960c8377ba058c1d0061"}},{"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":"88b503da527d96c53c10e41112eb578c9977fcd3470ed597cf7fbe4c9e8ebf6f"}},{"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":"64a4b4b15dfa05a455f06fdddaa1f7a42269abdfa99022d85c004a36d35f442f"}},{"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":"8e645c1ade3a0996977ef795671926d056d22f73a89d2544da5fdbd45e49cc18"}},{"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":"3404d21889f6387302d40547d6557fad724a83840fcd716913c2899cfbd70626"}},{"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":"c622bab8f3dace0cacee804422dc55592a6dcb7fd3b196d5086cd478627fe00f"}},{"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":"f3abe22e4c421cc309479e87266cc56cbfbda18790311a09f7837a81bd8e8e95"}},{"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":"ed6a79dc1315b2f2d82b47816fe8a694d150aefe09e0dadc6a42d129438067c8"}},{"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":"b67787f58bbdcde79a43cc08af597219f8bc8ccd5a82b8588a8f7af6b62ec402"}},{"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":"e3456a33515efc2e2b0fc6b725fb30396a686312092c39ebaa9032146e44ed46"}},{"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":"1f51a163f26d94ce6b6f473117dde579d091c8cbf9e59810475c94d9fc921120"}},{"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":"cc39f97015b0e1566036d789d53922bba2072d63eab03089d867030715401f8d"}},{"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":"c8422f654f8c6afb3c0d24522eb0339157db799f0c39bf494836649853f5f5ff"}},{"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":"e0672094bdc662391f3ef3acbe0c5f0b2b89c0d7b4cb0e52c6bbcddf6adad936"}},{"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":"7338b6e3572d9410338d43bcfba53cabf6968e857f05efc4bf35704882e5495b"}},{"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":"7edf43ee1a35996af60ac87e1dbea37479144a4264aba77bd1da5ad44c0aafbe"}},{"ruleId":"D34","level":"error","message":{"text":"Orphaned knowledge: No living knowledge remains for this large file \u2014 its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/proxy/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f90d90e3aca969b296f95053e8a1d7b015a381617f019a6434021c2f3dcfc30"}},{"ruleId":"D34","level":"error","message":{"text":"Orphaned knowledge: No living knowledge remains for this large file \u2014 its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/etcdserver/api/v2store/store.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"66b8bf7e53512f4a7325efe35b6a346234e07615e8e689fabd787d511216593a"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 84 smaller file(s) also have no living knowledge \u2014 folded into the freshness score and metrics rather than listed individually (86 orphaned of 305 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first)."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ce861fd78f6935114d3a342cb90ad25870f984e1042954fcbbe27c0e23be3658"}},{"ruleId":"D35","level":"error","message":{"text":"Boundary-crossing change coupling: etcd.go \u2194 etcd_features.go: \u0060server/embed/etcd.go\u0060 (context embed) and \u0060server/features/etcd_features.go\u0060 (context features) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) \u2014 the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can\u0027t see."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"server/embed/etcd.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"81e307ce939fd60db801286a77d2162b526d99d9e0211e5992a66f018285a751"}},{"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":"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":"f62d6b7c6b6517e5a6cf38c38d1b44b549282cd33c4dea422b08e66b44846175"}},{"ruleId":"D40","level":"note","message":{"text":"No network policy: No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"295828650a2aaa1b03ae9b32ae6843a0c38011e5a70b1926442c4fa7187de5f0"}},{"ruleId":"D41","level":"note","message":{"text":"No seccomp profile: Workloads do not set a seccomp profile (RuntimeDefault or a Localhost profile). Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3f418e9f76c3ac90484e0e94a454bfe9b08e914e1cdd218e1fc9e3b261a3bf6e"}},{"ruleId":"D41","level":"note","message":{"text":"No AppArmor/SELinux confinement: Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp\u0027s syscall filter."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"e83fbc31033373d6c51983ed230eb4ba61f7775ed02afb30f5fc1840bde01d4f"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1032","guid":"5f21e517-68aa-a650-9a25-5771ef024637","name":"OWASP Top Ten \u2014 Security Misconfiguration category","shortDescription":{"text":"OWASP Top Ten \u2014 Security Misconfiguration category"},"helpUri":"https://cwe.mitre.org/data/definitions/1032.html"},{"id":"CWE-1059","guid":"a2381a08-60f6-9554-a8b8-f3018cfaaca5","name":"Insufficient Technical Documentation","shortDescription":{"text":"Insufficient Technical Documentation"},"helpUri":"https://cwe.mitre.org/data/definitions/1059.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-16","guid":"659db3ea-affc-8453-8add-c1218fbfcb92","name":"Configuration","shortDescription":{"text":"Configuration"},"helpUri":"https://cwe.mitre.org/data/definitions/16.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-732","guid":"1da27e8f-b330-7650-ab63-bd61953eae5d","name":"Incorrect Permission Assignment for Critical Resource","shortDescription":{"text":"Incorrect Permission Assignment for Critical Resource"},"helpUri":"https://cwe.mitre.org/data/definitions/732.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":46,"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."]}]}